mirror of https://github.com/gorhill/uBlock.git
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
|
@ -1,7 +1,7 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
uBlock Origin - a browser extension to block requests.
|
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
|
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
|
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);
|
(doc.head || doc.documentElement).appendChild(script);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
}
|
}
|
||||||
if ( script && script.parentNode ) {
|
if ( script ) {
|
||||||
script.parentNode.removeChild(script);
|
if ( script.parentNode ) {
|
||||||
|
script.parentNode.removeChild(script);
|
||||||
|
}
|
||||||
|
script.textContent = '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -78,8 +78,11 @@
|
||||||
(d.head || d.documentElement).appendChild(script);
|
(d.head || d.documentElement).appendChild(script);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
}
|
}
|
||||||
if ( script && script.parentNode ) {
|
if ( script ) {
|
||||||
script.parentNode.removeChild(script);
|
if ( script.parentNode ) {
|
||||||
|
script.parentNode.removeChild(script);
|
||||||
|
}
|
||||||
|
script.textContent = '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
injectScriptlets(document);
|
injectScriptlets(document);
|
||||||
|
|
Loading…
Reference in New Issue