Jump to content
stop-it

background.js script problem HELP

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...