mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 09:31:01 +01:00
code review: remove scriplet js text after injection (see https://github.com/uBlockOrigin/uBlock-issues/issues/53#issuecomment-394024828)
This commit is contained in:
parent
2c843f6e69
commit
4a57825411
2 changed files with 11 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
/*******************************************************************************
|
||||
|
||||
uBlock Origin - a browser extension to block requests.
|
||||
Copyright (C) 2014-2017 Raymond Hill
|
||||
Copyright (C) 2014-2018 Raymond Hill
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -356,8 +356,11 @@ vAPI.injectScriptlet = function(doc, text) {
|
|||
(doc.head || doc.documentElement).appendChild(script);
|
||||
} catch (ex) {
|
||||
}
|
||||
if ( script && script.parentNode ) {
|
||||
script.parentNode.removeChild(script);
|
||||
if ( script ) {
|
||||
if ( script.parentNode ) {
|
||||
script.parentNode.removeChild(script);
|
||||
}
|
||||
script.textContent = '';
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -78,8 +78,11 @@
|
|||
(d.head || d.documentElement).appendChild(script);
|
||||
} catch (ex) {
|
||||
}
|
||||
if ( script && script.parentNode ) {
|
||||
script.parentNode.removeChild(script);
|
||||
if ( script ) {
|
||||
if ( script.parentNode ) {
|
||||
script.parentNode.removeChild(script);
|
||||
}
|
||||
script.textContent = '';
|
||||
}
|
||||
};
|
||||
injectScriptlets(document);
|
||||
|
|
Loading…
Reference in a new issue