Closed loadletter closed 9 years ago
What's the issue with just dropping the groups in a user's LocalStorage? That'd keep the benefit of one tight file while also preventing obnoxious load issues after the first go.
It sounds like your other suggestion is to have a groups/ID###.json file for each group. Is that correct?
About 1. Maybe separating into files with 500 number possibilities for groups each would do. Something like:
file 000.json
has, at most, the first 500 (assuming it starts with 0).
file 005.json
has, at most, between 500 and 999.
file 010.json
has, at most, between 1000 and 1499.
etc...
It's true that the distribution will be uneven but that's for the sake of easily hitting the right file faster.
@MilesWilford I could store those in the localstorage with some kind of timeout, but since even the simple offline version isn't that reliable i'm not sure. As for the splitting i was planning on just doing groups/$(ID % N).js where N is some number maybe 10 or 20 like @brunoais suggested.
@jrdp18
@brunoais
If you use localStorage (don't forget to namespace!!!) then point 2 is, most probably, a non-issue. If it is offline, it just uses the one on localStorage.
When it is time to update, you may just use the one on localStorage until it gets the new file with the updated version and then replace them in the DOM when an update comes.
So after a timeout check if the urlfix_grouplist variable is defined otherwise load the last file from localStorage? What would a reasonable timeout value be?
No timeout. Think like this:
Page loads:
Makes sense?
But i didn't use XMLHttpRequest because of
XMLHttpRequest is subject to the browser's same-origin policy: for security reasons, requests will only succeed if they are made to the same server that served the original web page.
I could use GM_XMLHttpRequest, but doing it with the script like it does now seems like the most portable way.
It's alright then.
Just use the onload callback to trigger the 6.
and 7.
I mention above
And add a warning when the fallback is being used and the use clicks on 'Suggest an update' like 'Could not fetch latest info, the website might be outdated, consider refreshing the page before submitting a new entry'
Don't use a warning for the fallback is used. Use it when the "suggest an update" is clicked and the fallback is under use, instead. If you think the users should be warned when the fallback is being used, try using a small image that demonstrates that.
Use it when the "suggest an update" is clicked and the fallback is under use, instead. Yes, that's what i meant
Hum... I mean the situation where it is both at the same time :) (or was it like that that you understood?)
Done, after updating to a dummy version both of the old versions should switch to the new one.
Since Chrome is always blocking the file whenever it's reopened, I'd like to ask you if you could provide a .crx version of it or at least the instructions to make it, since I don't know much about it...
Does this work for you? http://a.pomf.se/srmckc.crx I'll need some time to create one with autoupdating and all
Unfortunately, it still happens... I don't get it, I have the Sad Panda crx applied and it has never been blocked by Chrome so far...
Nope, I can still toss it directly from a folder into the Extensions Section and have it do it's magic but when I close Chrome and reopen it, it pops up a message stating that since the App wasn't from Google Store, it may be harmful content added against my will and simply stops it and blocks it's reactivation, forcing me to exclude it from the Extensions Section and toss it again, way troublesome... The Sad Panda .crx, an App that allows me to check a certain site free of troubles, ever since it was added in the Extensions Section, has never been deemed as harmful by Chrome or stopped or blocked... Hence me thinking that .crx files may be capable of steering clean from Chrome's antics...
@xrb-rick Just open the crx file with chrome. It should work that way.
It works, that's not the problem. Whenever I reopen Chrome, it stops and blocks the reactivation of the app, forcing me to exclude it from the Extensions Section and add it again and again...
Does it work if you install tampermonkey from the chrome store and install the script with that?
I never tried to get Tampermonkey, I'll give it a try.
EDIT: Had to get Tampermonkey, now it seems to be working just fine.
This is what happens when your freedom is removed to force you into a walled garden.
That was a good one but could you state it in more proper words, please?
Preventing direct installation of userscripts and profile directory tampering should be enough to block malware, disabling everything is just evil.
I thinking of doing something like this to make things easier:
Opinions?
@rhung @brunoais @jrdp18 @inkochan @tallos @zazuge @claireanlage @projectifinity @Syntonic