I decided to write an extension for vk.com in chrome. Lesson is nowhere easier. In "content_scripts" I connected my vkc_script.js, which worked on all "*: //vk.com/*". However, then I decided to write something more seriously, I wanted to connect jQuery and there was a problem:

jQuery on the page is:

jQuery .

but for some reason it does not work: error

Good people, pomagiti!


manifest.json:

{ "manifest_version": 2, "name": "VKColor", "description": "Color is important.", "version": "1.0", "content_scripts": [{ "matches": ["*://vk.com/*"], "js": ["/script/vkc_script.js", "/script/jquery.js"], "css": ["/script/vkc_style.css"] }] } 

If jQuery is dynamically connected to vkc_script.js, everything is fine, but this option does not suit me.

    1 answer 1

    Most likely the problem is that jquery.js picked up after vkc_script.js

    Therefore, most likely, you just need to change the order:

     "js": ["/script/jquery.js", "/script/vkc_script.js"]