Skip to content

Commit 2bb4e36

Browse files
lusarzjohnjbarton
authored andcommitted
fix: remove support of jsVersion configuration property (#3002)
Fixes #2911
1 parent 57b7938 commit 2bb4e36

4 files changed

Lines changed: 0 additions & 43 deletions

File tree

docs/config/01-configuration-file.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -794,18 +794,6 @@ All of Karma's urls get prefixed with the `urlRoot`. This is helpful when using
794794
sometimes you might want to proxy a url that is already taken by Karma.
795795

796796

797-
## jsVersion
798-
**Type:** Number
799-
800-
**Default:** `0`
801-
802-
**Description:** The JavaScript version to use in the Firefox browser.
803-
804-
If `> 0`, Karma will add a JavaScript version tag to the included JavaScript files.
805-
806-
Note: This will only be applied to the Firefox browser up to version 58. Support for JavaScript version was [removed](https://bugzilla.mozilla.org/show_bug.cgi?id=1428745) in Firefox 59. This property is deprecated and will be removed in the next major release of Karma.
807-
808-
809797
[plugins]: plugins.html
810798
[config/files]: files.html
811799
[config/browsers]: browsers.html

lib/middleware/karma.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
var path = require('path')
1515
var util = require('util')
1616
var url = require('url')
17-
var useragent = require('useragent')
1817
var _ = require('lodash')
1918

2019
var log = require('../logger').create('middleware:karma')
@@ -72,17 +71,6 @@ var getXUACompatibleUrl = function (url) {
7271
return value
7372
}
7473

75-
var isFirefox = function (req) {
76-
if (!(req && req.headers)) {
77-
return false
78-
}
79-
80-
// Browser check
81-
var firefox = useragent.is(req.headers['user-agent']).firefox
82-
83-
return firefox
84-
}
85-
8674
var createKarmaMiddleware = function (
8775
filesPromise,
8876
serveStaticFile,
@@ -99,7 +87,6 @@ var createKarmaMiddleware = function (
9987
var customContextFile = injector.get('config.customContextFile')
10088
var customDebugFile = injector.get('config.customDebugFile')
10189
var customClientContextFile = injector.get('config.customClientContextFile')
102-
var jsVersion = injector.get('config.jsVersion')
10390
var includeCrossOriginAttribute = injector.get('config.crossOriginAttribute')
10491

10592
var requestUrl = request.normalizedUrl.replace(/\?.*/, '')
@@ -221,19 +208,6 @@ var createKarmaMiddleware = function (
221208
var scriptFileType = (fileType || fileExt.substring(1))
222209
var scriptType = (SCRIPT_TYPE[scriptFileType] || 'text/javascript')
223210

224-
// In case there is a JavaScript version specified and this is a Firefox browser
225-
if (jsVersion && jsVersion > 0 && isFirefox(request)) {
226-
var agent = useragent.parse(request.headers['user-agent'])
227-
228-
log.warn('jsVersion configuration property is deprecated and will be removed in the next major release of Karma.')
229-
230-
if (agent.major < 59) {
231-
scriptType += ';version=' + jsVersion
232-
} else {
233-
log.warn('jsVersion is not supported in Firefox 59+ (see https://bugzilla.mozilla.org/show_bug.cgi?id=1428745 for more details). Ignoring.')
234-
}
235-
}
236-
237211
var crossOriginAttribute = includeCrossOriginAttribute ? CROSSORIGIN_ATTRIBUTE : ''
238212
scriptTags.push(util.format(SCRIPT_TAG, scriptType, filePath, crossOriginAttribute))
239213
}

test/client/karma.conf.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ module.exports = function (config) {
156156

157157
forceJSONP: true,
158158

159-
jsVersion: 0,
160-
161159
browserStack: {
162160
project: 'Karma'
163161
}

test/e2e/tag.feature

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Feature: JavaScript Tag
88
"""
99
files = ['tag/tag.js', 'tag/test-with-version.js'];
1010
browsers = ['Firefox']
11-
jsVersion = 1.8
1211
plugins = [
1312
'karma-jasmine',
1413
'karma-firefox-launcher'
@@ -26,7 +25,6 @@ Feature: JavaScript Tag
2625
"""
2726
files = ['tag/tag.js', 'tag/test-with-version.js'];
2827
browsers = ['Chrome'];
29-
jsVersion = 1.8;
3028
plugins = [
3129
'karma-jasmine',
3230
'karma-chrome-launcher'
@@ -72,4 +70,3 @@ Feature: JavaScript Tag
7270
.
7371
Chrome
7472
"""
75-

0 commit comments

Comments
 (0)