
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
karma-detect-browsers
Advanced tools
Karma runner plugin for detecting all browsers installed on the current system.
Karma runner plugin for detecting all browsers installed on the current system. Adds all found browsers to the browser array in the karma config file.
The easiest way is to keep karma-detect-browsers
as a devDependency in your package.json
.
{
"devDependencies": {
"karma": "^0.13",
"karma-detect-browsers": "^2.0"
}
}
You can simply do it by:
npm install karma-detect-browsers --save-dev
package.json
file// karma.conf.js
module.exports = function(config) {
config.set({
frameworks: ['detectBrowsers'],
plugins: [
'karma-chrome-launcher',
'karma-edge-launcher',
'karma-firefox-launcher',
'karma-ie-launcher',
'karma-safari-launcher',
'karma-safaritechpreview-launcher',
'karma-opera-launcher',
'karma-phantomjs-launcher',
'karma-detect-browsers'
]
});
};
// karma.conf.js
module.exports = function(config) {
config.set({
frameworks: ['detectBrowsers'],
// configuration
detectBrowsers: {
// enable/disable, default is true
enabled: true,
// enable/disable phantomjs support, default is true
usePhantomJS: true,
// use headless mode, for browsers that support it, default is false
preferHeadless: true,
// post processing of browsers list
// here you can edit the list of browsers used by karma
postDetection: function(availableBrowsers) {
/* Karma configuration with custom launchers
customLaunchers: {
IE9: {
base: 'IE',
'x-ua-compatible': 'IE=EmulateIE9'
}
}
*/
//Add IE Emulation
var result = availableBrowsers;
if (availableBrowsers.indexOf('IE')>-1) {
result.push('IE9');
}
//Remove PhantomJS if another browser has been detected
if (availableBrowsers.length > 1 && availableBrowsers.indexOf('PhantomJS')>-1) {
var i = result.indexOf('PhantomJS');
if (i !== -1) {
result.splice(i, 1);
}
}
return result;
}
},
plugins: [
'karma-chrome-launcher',
'karma-edge-launcher',
'karma-firefox-launcher',
'karma-ie-launcher',
'karma-safari-launcher',
'karma-safaritechpreview-launcher',
'karma-opera-launcher',
'karma-phantomjs-launcher',
'karma-detect-browsers'
]
});
};
In lieu of a formal styleguide take care to maintain the existing coding style. Lint and test your code using grunt.
You can preview your changes by running:
grunt demo
package.json
file of your projectCopyright (C) 2013-2018 Litixsoft GmbH info@litixsoft.de Licensed under the MIT license.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included i all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Karma runner plugin for detecting all browsers installed on the current system.
The npm package karma-detect-browsers receives a total of 55,998 weekly downloads. As such, karma-detect-browsers popularity was classified as popular.
We found that karma-detect-browsers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.