File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 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" : {
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" ,
Original file line number Diff line number Diff 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 ( / h t t p s ? : \/ \/ / . 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 ) {
Original file line number Diff line number Diff line change 1- import * as DOMPurify from ' dompurify' ;
1+ import DOMPurify from " dompurify" ;
22import KeyboardUtils from './keyboardUtils' ;
33import { RUNTIME , dispatchSKEvent , runtime } from './runtime.js' ;
44
You can’t perform that action at this time.
0 commit comments