CaptainNight
11-19-2014, 10:33 AM
So uh, im trying to make a google chrome extension that I eventually plan on sharing with this forum. This is literally my first ever coding project besides "Hello World" stuff in a highschool class several years ago. So excuse how noob I am.
All im trying to do is make a semi-legit RS Chrome extension that greys out junk items and highlights UBs.
Right now im just abusing IF loops and have all these shop lists directly in the content_script. So blah blah IF =shop&obj_type=30 THEN it sets var Junk to be Spooky Foods junk list and var UB to a Spooky Foods UB list.
Then I have it where it simply iterates all the image URLs through the var Junk and greys out all the Junk images, then iterates through UB list and expands those images. That leaves the junk items greyed out, UBs highly visible, and the other profitable items (like 5k-99k) normal.
This is functional right now and does exactly what I want it to do for the shops I have loaded. HOWEVER, the lists are typed directly into the content script and immutable :/ If I want to add or remove items I have to physically open up my extension files and its really annoying to have to dredge through the wall of image URLs to add to them. Not to mention that I have to repack the extension every time.
Ideally I would have something like in adblock where I can right click and add/remove to Junk/UB list for that particular shop, and also have some way to load text files provided by the user. Its also stupidly inefficient right now since it iterates through the whole list for every image, but that is not too bad. Mostly I want to have the read to and from storage functionality and I can figure out the rest from there. Iv found decent tutorials for the other stuff.
I can't for the life of me figure out how to host the lists NOT directly within the content_script. I would like to be able to edit the lists individually. I tried mucking around in adblockplus's source code for help but I can't actually find the functions that write to lists? Obviously it stores the whitelists/blacklists somewhere. The chrome documentation talks about the storage API but it doesn't tell me how to actually use it..
If someone could point me in the right direction to a noob tutorial that would be nice. Or provide a very simple example of using the API to store something in a list and then how to access that list?
It looks like this ([Only registered and activated users can see links]) right now and is kinda shitty but it actually REALLY helps in restocking semi-legit. Its like training wheels. Even if no one else ever uses it I think its a good project for myself.
All im trying to do is make a semi-legit RS Chrome extension that greys out junk items and highlights UBs.
Right now im just abusing IF loops and have all these shop lists directly in the content_script. So blah blah IF =shop&obj_type=30 THEN it sets var Junk to be Spooky Foods junk list and var UB to a Spooky Foods UB list.
Then I have it where it simply iterates all the image URLs through the var Junk and greys out all the Junk images, then iterates through UB list and expands those images. That leaves the junk items greyed out, UBs highly visible, and the other profitable items (like 5k-99k) normal.
This is functional right now and does exactly what I want it to do for the shops I have loaded. HOWEVER, the lists are typed directly into the content script and immutable :/ If I want to add or remove items I have to physically open up my extension files and its really annoying to have to dredge through the wall of image URLs to add to them. Not to mention that I have to repack the extension every time.
Ideally I would have something like in adblock where I can right click and add/remove to Junk/UB list for that particular shop, and also have some way to load text files provided by the user. Its also stupidly inefficient right now since it iterates through the whole list for every image, but that is not too bad. Mostly I want to have the read to and from storage functionality and I can figure out the rest from there. Iv found decent tutorials for the other stuff.
I can't for the life of me figure out how to host the lists NOT directly within the content_script. I would like to be able to edit the lists individually. I tried mucking around in adblockplus's source code for help but I can't actually find the functions that write to lists? Obviously it stores the whitelists/blacklists somewhere. The chrome documentation talks about the storage API but it doesn't tell me how to actually use it..
If someone could point me in the right direction to a noob tutorial that would be nice. Or provide a very simple example of using the API to store something in a list and then how to access that list?
It looks like this ([Only registered and activated users can see links]) right now and is kinda shitty but it actually REALLY helps in restocking semi-legit. Its like training wheels. Even if no one else ever uses it I think its a good project for myself.