Hello, I have a problem with my javascript.
When I run it from the developer console the code is working. When I use my code to create the extension - I receive error.
Thanks in advance!
What I have tried:
var fullOffer = document.querySelectorAll('.js-offer-proceed')[0];
var len = fullOffer.querySelectorAll('.cartlist__item');
Later I'm using fullOffer variable to extract specific data from the screen without any problem.
When I add this code as extension I receive this error:
Screenshot of the error[
^]
What can be the reason to run without any problems the code in developer console, but when I store the code in .js file and import it as extension to stop working?
This is the code from the manifest file:
{
"manifest_version": 2,
"name": "Getting started example",
"description": "This extension shows a Google Image search result for the current page",
"version": "1.0",
"permissions": [
"storage"
],
"background": {
"scripts": ["background.js"],
"persistent": false
},
"permissions": [
"activeTab",
"https://ajax.googleapis.com/"
]
}
I try just to create a simple alert message when I click button and the extension is working, so I expect the problem maybe it's not in the Manifest file, but not sure?
It's actually my first extension.