mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-09-28 23:31:09 +12:00
this fixes #232 + AMO feedback re. using innerHTML
This commit is contained in:
parent
5997dec5d1
commit
ef68842b80
2 changed files with 0 additions and 39 deletions
|
@ -69,35 +69,6 @@ vAPI.shutdown.add(function() {
|
|||
/******************************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
// Unrendered noscript (because CSP) workaround
|
||||
|
||||
// Executed once.
|
||||
|
||||
(function() {
|
||||
var checkScriptBlacklistedHandler = function(response) {
|
||||
if ( !response.scriptBlacklisted ) {
|
||||
return;
|
||||
}
|
||||
var scripts = document.querySelectorAll('noscript');
|
||||
var i = scripts.length;
|
||||
var realNoscript, fakeNoscript;
|
||||
while ( i-- ) {
|
||||
realNoscript = scripts[i];
|
||||
fakeNoscript = document.createElement('div');
|
||||
fakeNoscript.innerHTML = '<!-- uMatrix NOSCRIPT tag replacement: see <https://github.com/gorhill/httpswitchboard/issues/177> -->\n' + realNoscript.textContent;
|
||||
realNoscript.parentNode.replaceChild(fakeNoscript, realNoscript);
|
||||
}
|
||||
};
|
||||
|
||||
localMessager.send({
|
||||
what: 'checkScriptBlacklisted',
|
||||
url: window.location.href
|
||||
}, checkScriptBlacklistedHandler);
|
||||
})();
|
||||
|
||||
/******************************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
// Executed only once.
|
||||
|
||||
(function() {
|
||||
|
|
|
@ -522,16 +522,6 @@ var onMessage = function(request, sender, callback) {
|
|||
var response;
|
||||
|
||||
switch ( request.what ) {
|
||||
case 'checkScriptBlacklisted':
|
||||
response = {
|
||||
scriptBlacklisted: µm.mustBlock(
|
||||
µm.scopeFromURL(request.url),
|
||||
µm.hostnameFromURL(request.url),
|
||||
'script'
|
||||
)
|
||||
};
|
||||
break;
|
||||
|
||||
case 'contentScriptHasLocalStorage':
|
||||
response = contentScriptLocalStorageHandler(tabId, request.url);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue