Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
this fixes #232 + AMO feedback re. using innerHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed May 31, 2015
1 parent 5997dec commit ef68842
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
29 changes: 0 additions & 29 deletions src/js/contentscript-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
10 changes: 0 additions & 10 deletions src/js/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ef68842

Please sign in to comment.