Merge pull request #2 from mfcc64/modify
content_script: wrap inject() inside anonymous function
This commit is contained in:
commit
30c7441abe
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@
|
|||
|
||||
var injectScript = document.createElement('script');
|
||||
// Use textContent instead of src to run inject() synchronously
|
||||
injectScript.textContent = inject.toString() + "inject();";
|
||||
injectScript.textContent = "(function(){" + inject.toString() + "inject();})();";
|
||||
injectScript.onload = function() {
|
||||
// Remove <script> node after injectScript runs.
|
||||
this.parentNode.removeChild(this);
|
||||
|
|
Loading…
Reference in a new issue