fix(code-uri): Chrome iframe error with XSS Auditor
- remove solution from URI when read - remove querify solution upon edit or reset
This commit is contained in:
@ -134,6 +134,20 @@ window.common = (function(global) {
|
|||||||
(location.search || location.hash).replace(queryRegex, ''),
|
(location.search || location.hash).replace(queryRegex, ''),
|
||||||
'run'
|
'run'
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
removeCodeUri: function(location, history) {
|
||||||
|
if (
|
||||||
|
typeof location.href.split !== 'function' ||
|
||||||
|
typeof history.replaceState !== 'function'
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
history.replaceState(
|
||||||
|
history.state,
|
||||||
|
null,
|
||||||
|
location.href.split('#')[0]
|
||||||
|
);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -103,6 +103,7 @@ window.common = (function(global) {
|
|||||||
let editorValue;
|
let editorValue;
|
||||||
if (common.codeUri.isAlive()) {
|
if (common.codeUri.isAlive()) {
|
||||||
editorValue = common.codeUri.parse();
|
editorValue = common.codeUri.parse();
|
||||||
|
common.codeUri.removeCodeUri(location, window.history);
|
||||||
} else {
|
} else {
|
||||||
editorValue = common.codeStorage.isAlive(common.challengeName) ?
|
editorValue = common.codeStorage.isAlive(common.challengeName) ?
|
||||||
common.codeStorage.getStoredValue(common.challengeName) :
|
common.codeStorage.getStoredValue(common.challengeName) :
|
||||||
|
@ -24,7 +24,6 @@ $(document).ready(function() {
|
|||||||
code$.subscribe(
|
code$.subscribe(
|
||||||
code => {
|
code => {
|
||||||
common.codeStorage.updateStorage(common.challengeName, code);
|
common.codeStorage.updateStorage(common.challengeName, code);
|
||||||
common.codeUri.querify(code);
|
|
||||||
},
|
},
|
||||||
err => console.error(err)
|
err => console.error(err)
|
||||||
);
|
);
|
||||||
@ -72,7 +71,6 @@ $(document).ready(function() {
|
|||||||
return common.updateOutputDisplay('' + err);
|
return common.updateOutputDisplay('' + err);
|
||||||
}
|
}
|
||||||
common.codeStorage.updateStorage(challengeName, originalCode);
|
common.codeStorage.updateStorage(challengeName, originalCode);
|
||||||
common.codeUri.querify(originalCode);
|
|
||||||
common.displayTestResults(tests, true);
|
common.displayTestResults(tests, true);
|
||||||
common.updateOutputDisplay(output);
|
common.updateOutputDisplay(output);
|
||||||
return null;
|
return null;
|
||||||
|
Reference in New Issue
Block a user