stop-it Posted August 16, 2014 Share Posted August 16, 2014 (edited) 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. thanks to all Edited August 16, 2014 by stop-it Link to comment Share on other sites More sharing options...
davej Posted August 16, 2014 Share Posted August 16, 2014 Have you tried to use local storage? http://www.w3schools.com/html/html5_webstorage.asp Actually you probably need this... https://developer.chrome.com/extensions/storage Link to comment Share on other sites More sharing options...
stop-it Posted August 16, 2014 Author Share Posted August 16, 2014 (edited) 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 August 16, 2014 by stop-it Link to comment Share on other sites More sharing options...
davej Posted August 17, 2014 Share Posted August 17, 2014 It may not be possible to have more than 5MB of local storage. You will have to search the web for possible solutions. Perhaps your extension can store the URL's on a server and then access them as needed. https://developer.chrome.com/extensions/xhr Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now