1

I am trying to create a simple Chrome extension that takes a javescript from an external provider and simply appends it to the webpage I am viewing. This is for any webpage and not to be selective. When I attempt this nothing loads:

Manifest.json

  {
        "name": "My Extension",
        "version": "0.1.1",
        "description": "Testing Tests!",
        "manifest_version": 2,
        "content_scripts": [
            {
                "matches": ["http://*/*", "https://*/*"],
                "js": ["contentscript.js"]
    
            }
        ]

       

    }

contentscript.js

alert("content script");

<script>
var _elev = window._elev || {};(function() {var i,e;i=document.createElement("script"),i.type='text/javascript';i.async=1,i.src="https://static.elev.io/js/v3.js",e=document.getElementsByTagName("script")[0],e.parentNode.insertBefore(i,e);})();
_elev.account_id = '1234566';
</script>

I am new to extensions so help or guidance on how to insert this script to all pages I visit.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.