Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit cb81c2d

Browse files
committed
Bug 1954074 - drop the now-unneeded github-only module exporting code in the webcompat addon, and load the modules without eval in the tests; r?denschub
1 parent fb30e1d commit cb81c2d

13 files changed

Lines changed: 25 additions & 244 deletions

spec/intervention_helpers.spec.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

spec/ua_helpers.spec.js

Lines changed: 0 additions & 155 deletions
This file was deleted.

src/data/shims.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,4 +1027,6 @@ const AVAILABLE_SHIMS = [
10271027
},
10281028
];
10291029

1030-
module.exports = AVAILABLE_SHIMS;
1030+
if (typeof module !== "undefined") {
1031+
module.exports = AVAILABLE_SHIMS;
1032+
}

src/lib/about_compat_broker.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
"use strict";
66

7-
/* global browser, module, onMessageFromTab */
7+
/* global browser, onMessageFromTab */
88

99
class AboutCompatBroker {
1010
constructor(bindings) {
@@ -122,5 +122,3 @@ class AboutCompatBroker {
122122
});
123123
}
124124
}
125-
126-
module.exports = AboutCompatBroker;

src/lib/custom_functions.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
"use strict";
66

7-
/* globals browser, module */
7+
/* globals browser */
88

99
const replaceStringInRequest = (
1010
requestId,
@@ -35,7 +35,7 @@ const replaceStringInRequest = (
3535
};
3636
};
3737

38-
const CUSTOM_FUNCTIONS = {
38+
var CUSTOM_FUNCTIONS = {
3939
replace_string_in_request: {
4040
details: ["find", "replace", "urls", "types"],
4141
enable(details) {
@@ -99,5 +99,3 @@ const CUSTOM_FUNCTIONS = {
9999
},
100100
},
101101
};
102-
103-
module.exports = CUSTOM_FUNCTIONS;

src/lib/intervention_helpers.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
"use strict";
66

7-
/* globals browser, module, UAHelpers */
7+
/* globals browser, UAHelpers */
88

99
const GOOGLE_TLDS = [
1010
"com",
@@ -415,5 +415,3 @@ var InterventionHelpers = {
415415
return InterventionHelpers.matchPatternsForTLDs(base, suffix, GOOGLE_TLDS);
416416
},
417417
};
418-
419-
module.exports = InterventionHelpers;

src/lib/interventions.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
"use strict";
66

7-
/* globals browser, InterventionHelpers, module */
7+
/* globals browser, InterventionHelpers */
88

99
class Interventions {
1010
constructor(availableInterventions, customFunctions) {
@@ -430,5 +430,3 @@ class Interventions {
430430
return [registration];
431431
}
432432
}
433-
434-
module.exports = Interventions;

src/lib/module_shim.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/lib/shims.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,4 +1307,6 @@ class Shims {
13071307
}
13081308
}
13091309

1310-
module.exports = Shims;
1310+
if (typeof module !== "undefined") {
1311+
module.exports = Shims;
1312+
}

src/lib/ua_helpers.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
"use strict";
66

7-
/* globals browser, exportFunction, module */
7+
/* globals browser, exportFunction */
88

99
var UAHelpers = {
1010
_deviceAppropriateChromeUAs: {},
@@ -159,7 +159,3 @@ var UAHelpers = {
159159
return `Mozilla/5.0 (Windows NT 10.0; Win64; x64; ${rv}) Gecko/20100101 ${ver}`;
160160
},
161161
};
162-
163-
if (typeof module !== "undefined") {
164-
module.exports = UAHelpers;
165-
}

0 commit comments

Comments
 (0)