Jump to content

background.js script problem HELP


stop-it

Recommended Posts

Hi to all, i hope to find some help here.

 

This is my problem, which need urgent help.

 

Im working on a chrome extension, VERY VERY basic.

My extension block a list of "urls" so i have 2 files for my chrome extension, my manifest.json and background.js

 

Code of manifest.json:

 

{"name":"Stop-it","description":"app","version":"1.0,"manifest_version":2,"permissions": ["webRequest","webRequestBlocking","unlimitedStorage"],"icons":{"48":"icon.png"},"background":{"scripts": ["background.js"]},"browser_action":{"default_popup":"popup.html","default_icon":"icon.png"}}

 

and the code of my background.js:

 

chrome.webRequest.onBeforeRequest.addListener(

function(details) {return {cancel: true};}, { urls:[

.url1,
.url2,
etc...

]

},['blocking']);

 

at the moment i store all the urls, inside the background.js, and thats the problem, because its a list of urls i update every week, and my urls list has 2 millions urls, so when i install my extension, and start browsing, chrome become really really slower.

 

I really need help on this problem, the manifest.json, is perfect and work perfectly, the problem come from my background.js, how to store all those urls on the user computer, instead of the background.js, i add here a jpeg file who show the memory consumption in chrome.post-175766-0-32576900-1408167941_thumb.jpg

 

thanks to all

Edited by stop-it
Link to comment
Share on other sites

i spent one week reading almost every article, but i don't know how to implement that on my background.js, and how to put all my urls, outside the background.js and store that on the hdd, also i have more than 2 millions urls, not just "words"

Edited by stop-it
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...