Skip to content

Commit

Permalink
1.17.6
Browse files Browse the repository at this point in the history
Fixed #2241 settings config file not loaded everytime in Firefox
  • Loading branch information
brookhong committed Feb 23, 2025
1 parent 7f6cc57 commit e60dbf1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Surfingkeys",
"version": "1.17.5",
"version": "1.17.6",
"description": "Map your keys for web surfing, expand your browser with javascript and keyboard.",
"main": "background.js",
"directories": {
Expand Down Expand Up @@ -70,7 +70,7 @@
"@pixi/utils": "^7.4.0",
"@pixi/extensions": "^7.4.0",
"ace-builds": "^1.4.12",
"dompurify": "^2.3.1",
"dompurify": "^3.2.4",
"js-base64": "^3.7.2",
"lodash": "^4.17.21",
"marked": "^4.0.10",
Expand Down
14 changes: 12 additions & 2 deletions src/background/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ function start(browser) {
set.autoproxy_hosts = [set.autoproxy_hosts];
}
if (set.localPath) {
request(set.localPath, function(resp) {
request(appendNonce(set.localPath), function(resp) {
set.snippets = resp;
cb(set);
}, undefined, undefined, function (po) {
Expand Down Expand Up @@ -640,8 +640,18 @@ function start(browser) {
});
};

function appendNonce(url) {
if (/https?:\/\//.test(url)) {
url = url.replace(/\?$/, "");
let u = new URL(url);
let con = u.search ? "&" : "?";
url = `${url}${con}nonce=${new Date().getTime()}`;
}
return url;
}

function _loadSettingsFromUrl(url, cb) {
request(url, function(resp) {
request(appendNonce(url), function(resp) {
_updateAndPostSettings({localPath: url, snippets: resp});
cb({status: "Succeeded", snippets: resp});
}, undefined, undefined, function (po) {
Expand Down
2 changes: 1 addition & 1 deletion src/content_scripts/common/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as DOMPurify from 'dompurify';
import DOMPurify from "dompurify";
import KeyboardUtils from './keyboardUtils';
import { RUNTIME, dispatchSKEvent, runtime } from './runtime.js';

Expand Down

0 comments on commit e60dbf1

Please sign in to comment.