Merge pull request #2 from mfcc64/modify

content_script: wrap inject() inside anonymous function
This commit is contained in:
Shimmermare 2020-06-15 20:12:46 +04:00 committed by GitHub
commit 30c7441abe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);