在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:karma-runner/karma-firefox-launcher开源软件地址:https://github.com/karma-runner/karma-firefox-launcher开源编程语言:JavaScript 99.4%开源软件介绍:karma-firefox-launcher
InstallationThe easiest way is to keep You can simple do it by: npm install karma-firefox-launcher --save-dev Configuration// karma.conf.js
module.exports = function(config) {
config.set({
plugins: [
require('karma-firefox-launcher')
],
browsers: ['Firefox', 'FirefoxDeveloper', 'FirefoxAurora', 'FirefoxNightly'],
})
} You can pass list of browsers as a CLI argument too: karma start --browsers Firefox,Chrome To run Firefox in headless mode, append Environment variablesYou can specify the location of the Firefox executable using the following environment variables:
Custom Firefox locationIn addition to Environment variables you can specify location of the Firefox executable in a custom launcher: browsers: ['Firefox68', 'Firefox78'],
customLaunchers: {
Firefox68: {
base: 'Firefox',
name: 'Firefox68',
command: '<path to FF68>/firefox.exe'
},
Firefox78: {
base: 'Firefox',
name: 'Firefox78',
command: '<path to FF78>/firefox.exe'
}
} Custom PreferencesTo configure preferences for the Firefox instance that is loaded, you can specify a custom launcher in your Karma
config with the preferences under the browsers: ['FirefoxAutoAllowGUM'],
customLaunchers: {
FirefoxAutoAllowGUM: {
base: 'Firefox',
prefs: {
'media.navigator.permission.disabled': true
}
}
} Loading Firefox ExtensionsIf you have extensions that you want loaded into the browser on startup, you can specify the full path to each
extension in the browsers: ['FirefoxWithMyExtension'],
customLaunchers: {
FirefoxWithMyExtension: {
base: 'Firefox',
extensions: [
path.resolve(__dirname, 'helpers/extensions/[email protected]'),
path.resolve(__dirname, 'helpers/extensions/[email protected]')
]
}
} Please note: the extension name must exactly match the 'id' of the extension. You can discover the 'id' of your
extension by extracting the .xpi (i.e. <?xml version="1.0" encoding="utf-8"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>myCustomExt@suchandsuch</em:id>
<em:version>1.0</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:unpack>false</em:unpack>
[...]
</Description>
</RDF> Then you should name your extension For more information on Karma see the homepage. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论