Skip to content

Commit e60dbf1

Browse files
committed
1.17.6
Fixed #2241 settings config file not loaded everytime in Firefox
1 parent 7f6cc57 commit e60dbf1

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Surfingkeys",
3-
"version": "1.17.5",
3+
"version": "1.17.6",
44
"description": "Map your keys for web surfing, expand your browser with javascript and keyboard.",
55
"main": "background.js",
66
"directories": {
@@ -70,7 +70,7 @@
7070
"@pixi/utils": "^7.4.0",
7171
"@pixi/extensions": "^7.4.0",
7272
"ace-builds": "^1.4.12",
73-
"dompurify": "^2.3.1",
73+
"dompurify": "^3.2.4",
7474
"js-base64": "^3.7.2",
7575
"lodash": "^4.17.21",
7676
"marked": "^4.0.10",

src/background/start.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ function start(browser) {
273273
set.autoproxy_hosts = [set.autoproxy_hosts];
274274
}
275275
if (set.localPath) {
276-
request(set.localPath, function(resp) {
276+
request(appendNonce(set.localPath), function(resp) {
277277
set.snippets = resp;
278278
cb(set);
279279
}, undefined, undefined, function (po) {
@@ -640,8 +640,18 @@ function start(browser) {
640640
});
641641
};
642642

643+
function appendNonce(url) {
644+
if (/https?:\/\//.test(url)) {
645+
url = url.replace(/\?$/, "");
646+
let u = new URL(url);
647+
let con = u.search ? "&" : "?";
648+
url = `${url}${con}nonce=${new Date().getTime()}`;
649+
}
650+
return url;
651+
}
652+
643653
function _loadSettingsFromUrl(url, cb) {
644-
request(url, function(resp) {
654+
request(appendNonce(url), function(resp) {
645655
_updateAndPostSettings({localPath: url, snippets: resp});
646656
cb({status: "Succeeded", snippets: resp});
647657
}, undefined, undefined, function (po) {

src/content_scripts/common/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as DOMPurify from 'dompurify';
1+
import DOMPurify from "dompurify";
22
import KeyboardUtils from './keyboardUtils';
33
import { RUNTIME, dispatchSKEvent, runtime } from './runtime.js';
44

0 commit comments

Comments
 (0)