-
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1068 from capricorn86/task/1067-fix-problems-with…
…-the-useragent-implementation #1067@major: Changes the default user agent.
- Loading branch information
Showing
6 changed files
with
89 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import FS from 'fs'; | ||
import Path from 'path'; | ||
|
||
/** | ||
* Utility for navigator. | ||
*/ | ||
export default class NavigatorUtility { | ||
/** | ||
* Returns the package version. | ||
* | ||
* @returns Package version. | ||
*/ | ||
public static getHappyDOMVersion(): string { | ||
const content = FS.readFileSync(Path.join(__dirname, '..', '..', 'package.json')).toString(); | ||
const json = JSON.parse(content); | ||
return json.version; | ||
} | ||
|
||
/** | ||
* Returns platform. | ||
* | ||
* @returns Platform. | ||
*/ | ||
public static getPlatform(): string { | ||
const platform = process.platform; | ||
const platformCapitalized = platform.charAt(0).toUpperCase() + platform.slice(1); | ||
return 'X11; ' + platformCapitalized + ' ' + process.arch; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters