Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing remote, or any JSON #132

Open
reitzig opened this issue Apr 14, 2017 · 46 comments
Open

Importing remote, or any JSON #132

reitzig opened this issue Apr 14, 2017 · 46 comments

Comments

@reitzig
Copy link

reitzig commented Apr 14, 2017

I used to be able to use

https://gist.githubusercontent.com/reitzig/7ca05408f53292505294/raw/def-comments-csSE.json

as remote URL and get the JSON from there (Firefox). Now the user script forgot my custom comments so I wanted to re-load them, but it does not work any longer, even with all script blockers deactivated. Maybe related to #39? Used to work after 2014, though.

I also can't seem to be able to import the JSON by copy-pasting it (clicking "jsonp" in the import/export tool will only give me the current set as export, but there's no "save"); do I really have to reformat it all into the (new?) Markdown format for manual import?

How can I get the remote source to work again?

Workaround: Convert to the Markdown format and import manually.

@cellio
Copy link

cellio commented May 14, 2017

I've been having this problem for a couple months too, in both Chrome and Firefox. My custom comments went away, I said "huh that's odd" and tried reimporting, and the import spins forever without completing.

@oliversalzburg
Copy link
Collaborator

I hope I'm not stepping on the feet of other contributors, but I think, unless you're opening the PR yourself, there are unlikely going to be any fixes anytime soon. I'd be happy to help anyone getting started with the code base.

@reitzig
Copy link
Author

reitzig commented May 15, 2017

If there are features the contributers can't support, then take them out? That much should be an easy and quick task.

One import and export method is quite enough (assuming it's well-documented); the rest is convenience. But the one should work reliably, otherwise the script is nearly useless. :/

@oliversalzburg
Copy link
Collaborator

oliversalzburg commented May 15, 2017

That much should be an easy and quick task.

Feel free to submit a PR.

@Benjol
Copy link
Owner

Benjol commented May 15, 2017 via email

@Benjol
Copy link
Owner

Benjol commented May 15, 2017 via email

@Benjol
Copy link
Owner

Benjol commented May 15, 2017

(Sorry, stream of conciousness debugging here)
If I try the github from @reitzig, FFx console says
The resource from “https://raw.githubusercontent.com/Benjol/SE-AutoReviewComments/master/dist/autoreviewcomments.user.js” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff)

There's a link which sends me here, which is as clear as mud to me.

This on Stack Overflow makes me wonder if the problem isn't at github's end (in this particular case).

Of course all of this may be complete rubbish and related to firewall problems where I am right now!

Hoping maybe my five minutes will help move things forwards a bit.

@cellio
Copy link

cellio commented May 15, 2017

@oliversalzburg I came here because the post on Stack Apps (https://stackapps.com/q/2116/21539) directs people here for bug reports. That post was my entire context for this repo before coming here. I didn't know that bug reports were only welcome with accompanying PRs. If the guidance has changed, could someone update that post (or let me know and I'll submit an edit)?

If converting to another format fixes the problem, that works for me -- I'm only using jsonp because that's what the doc over on SE says. I'm just looking for a way to synchronize my comment templates across several devices and browsers.

@Benjol thanks for your work on this tool.

@oliversalzburg
Copy link
Collaborator

I didn't know that bug reports were only welcome with accompanying PRs.

All bug reports are welcome. It's just unlikely that they will be handled by the original authors anytime soon. So, if you want to make sure that a fix becomes available ASAP, submitting a PR helps :)

@cellio
Copy link

cellio commented May 15, 2017

Ok, got it. Not equipped to provide the PR, alas.

@reitzig
Copy link
Author

reitzig commented May 15, 2017

@cellio The remote issue won't be solved by using Markdown, I think. But the manual import works, at least.

@Benjol
Copy link
Owner

Benjol commented May 15, 2017 via email

@cellio
Copy link

cellio commented May 15, 2017

Yeah, I'm not criticizing anybody for not keeping up with changes in the web ecosystem. If you thought I was, please accept my apologies for the miscommunication. I appreciate the work of people who volunteer their time and effort to make improvements like this script.

@Benjol
Copy link
Owner

Benjol commented May 15, 2017 via email

@Benjol
Copy link
Owner

Benjol commented May 18, 2017

Could someone try importing from somewhere other than github?
Would be interesting to work out if the problem is on the server or client end...

@cellio
Copy link

cellio commented May 18, 2017

I don't store mine on GitHub:

http://www.pobox.com/~cellio/se/comments/

@Benjol
Copy link
Owner

Benjol commented May 22, 2017

@cellio, now this IS weird, because I just tried yours and they worked?! (I clicked the import "get now" link). Can you try again?

@cellio
Copy link

cellio commented May 23, 2017

@Benjol hmm, that's weird! It's still spinning from me (Chrome and Firefox, Mac 10.12). Just in case there's something weird in the JSON for just one of them, I tried yodeya.jsonp last week and then manually added them, and today I tested with writers.jsonp.

@Benjol
Copy link
Owner

Benjol commented May 23, 2017

@cellio, I tried again, it didn't work :(

Just read this on StackApps (comments on this answer), if someone wants to try.

"Just in case anyone else is looking to do this, if you want to store your JSONP on GitHub you will need to use the file extension .js and then use RawGit to serve the content up using the correct, executable, mime type."

Note that this problem is going to be complicated (or may even be caused?) by the fact that SE have switched to https. #134

@IzzySoft
Copy link
Contributor

IzzySoft commented May 18, 2018

Any idea at all why the custom comments are frequently forgotten? For me, this happens about twice a week, on multiple machines (with Firefox 56 on Linux as well as Waterfox on Windows), and I've got to copy-paste from my Gist then (auto-pull doesn't work, as reported above). To clarify: the auto-import not working I can live with. What bothers me is the script's permanent Alzheimers.

@Benjol
Copy link
Owner

Benjol commented May 19, 2018 via email

@IzzySoft
Copy link
Contributor

@Benjol I don't remember what time it started. Unless you did some GDPR changes, I doubt it's that. I rather suspected some FF changes (v55+), but I'm not sure. In the interim I thought it might be my cookie policy (for some reason I had permitted session cookies only), but even after allowing all cookies, the issue persists. Just had it again yesterday. And it's hard to trace – as when they're gone it's already to late, and before that you can't tell when it happens next. Not sure if it's a general issue with localStorage either, as I'm not aware of something else I use which uses that.

@oliversalzburg
Copy link
Collaborator

As Chrome says in response to the request:

Refused to execute script from 'https://gist.githubusercontent.com/reitzig/7ca05408f53292505294/raw/def-comments-csSE.json?jsonp=callback&_=1529319730589' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

This is not going to work because Gist provides the data as text/plain. The reason that this is not working is by-design. The data needs to be provided with the correct MIME type for this to function.

https://stackoverflow.com/questions/39228657/disable-chrome-strict-mime-type-checking

@IzzySoft
Copy link
Contributor

@oliversalzburg OK, that explains the import part. But not why the data is frequently forgotten. What does purge it from localStorage? Any idea?

@IzzySoft
Copy link
Contributor

@oliversalzburg could one of the answers to how to create a gist in github that returns json data work?

@oliversalzburg
Copy link
Collaborator

To my understanding, LocalStorage is cleared if you clear your browser history. Of course the details depend on browser, version, clear options, but there is always the potential to also clear the items stored in LocalStorage for a site. I would assume this is a common reason for the observed behavior.

Additionally, Stack Overflow sites have moved to HTTPS a while ago, which made them new sites from the browsers perspective. I assume some reports of this behavior are due to this switch.

Regarding the approach from the question you linked, I guess anything that results in the proper MIME type on the response will work just fine. As the answers suggest, rawgit allows for this, so that should work fine.

@IzzySoft
Copy link
Contributor

@oliversalzburg

LocalStorage is cleared if you clear your browser history.

That's one possibility (doesn't match the occurences here, as I did no such thing). A second possibility is they are bound to the cookie policy. So e.g. SDC (Self Destructing Cookies; pre-FF57 Firefox addon) purges localStorage along with the cookies if they expire – which is why I mentioned that above. Should no longer be the case here as I've set the cookies for "my SE sites" to never expire (unless the server requests that). And as far as I understood this script, it should store them with the 1st party (just checked: it does).

Stack Overflow sites have moved to HTTPS a while ago, which made them new sites from the browsers perspective

That counts for one time, and then I was aware of that. But after that, it had happened multiple times again already (hm, though not before, now that you mention it).

Concerning Rawgit: I might try that next time, cloning one of my Gists to a .json representation before.

@oliversalzburg
Copy link
Collaborator

The only thing I can add is that we also use LocalStorage extensively in our company products and I am not aware of a single case where the data stored there "cleared itself". Maybe some script on the sites clears the information stored there. Maybe they clear it on logout.

Was this noticed in non-Firefox browsers too?

@IzzySoft
Copy link
Contributor

Maybe some script on the sites clears the information stored there.

That would mean everybody using this script must have this issue. I don't know who does, so I cannot ask for confirmation. The only item I cannot match to ARC in localStorage is one with the key se:fkey – which indeed is from SE itself. And they might reset that from time to time, in the wrong way ("clear all localStorage as we don't know of any other items here"). Any idea whom to ask?

Was this noticed in non-Firefox browsers too?

I cannot tell, not using any.

@cellio @reitzig can one of you confirm the above?

@reitzig
Copy link
Author

reitzig commented Jun 19, 2018

I have not been experiencing forgotten comments.
I seem to remember one instance (might have been the SSL thing) but it's definitely not happened in a while.

Using Firefox, currently 60.0.2.

@IzzySoft
Copy link
Contributor

Thanks, @reitzig – so it's unlikely to be triggered by some SE cleanup script. I have this symptom with two browers: Waterfox 56.2 (also had it with 56.1 before) on Win7, and Firefox 55.* on Linux (which I haven't yet replaced by Waterfox).

@reitzig
Copy link
Author

reitzig commented Jun 19, 2018

Come to think of it, I also use SOUP, which may or may not influence how SE interacts with AutoReviewComments.

@IzzySoft
Copy link
Contributor

I've just had it again. Wish there was a log to check for the culprit.

@cellio
Copy link

cellio commented Jun 19, 2018

@IzzySoft I haven't recently noticed comments disappearing. I haven't tried auto-update in ages because of the earlier comments; when I change something I just re-import. (And I'm using markdown now instead of json.)

I'm using Firefox (which I just checked) and Chrome (which I'll verify again later). I also use SOUP.

@IzzySoft
Copy link
Contributor

Sounds like I have to take a look into the kitchen. Can any of you two (@cellio and @reitzig ) give me some link to find me some soup?

@reitzig
Copy link
Author

reitzig commented Jun 20, 2018

Here you go! Greatest SO userscript, period.

@IzzySoft
Copy link
Contributor

Thanks! Installed on my Linux machine. Though I couldn't find out what exactly it does. Guess I'll learn that shortly, at least part of it 😁

@IzzySoft
Copy link
Contributor

IzzySoft commented Jul 2, 2018

Unfortunately SOUP doesn't fix it for me. AutoReviewComment is still "forgetting" my comments about once a week – but always only for one SE site at a time.

Need to take a closer look at when this happens. Right now, it was on the first call after a browser restart. Not sure if it was the same in all other cases.

This SO post says:

In Firefox, localStorage is cleared when these three conditions are met: (a) user clears recent history, (b) cookies are selected to be cleared, (c) time range is "Everything"

In my case, neither a nor b are met. No idea what c refers to. But it might well be that one cookie has expired and got cleared/refreshed.

(Note to self: if it's cookies, next on WF should be ASE on August 1st (sgt))

@pmahend1
Copy link

pmahend1 commented Jul 2, 2018

@IzzySoft Sorry. It doesnt anymore. deleting my comment so that it wont distract users.

@L0Lock
Copy link

L0Lock commented Jul 24, 2024

Hi, i am having trouble getting my custom remote jsonp for blender se:

https://raw.githubusercontent.com/L0Lock/BlenderSE-ProFormaComments/master/comments.jsonp

It just shows a red "error" next to auto-get and doesn't import anything.

I am no web expert so I don't know much where to look up for logs and whatnot. It doesn't show anything new in the console when running, but there is this "issue" that seems related to my comments file:

image

@Benjol
Copy link
Owner

Benjol commented Jul 28, 2024

I'm very sorry, but this hasn't been maintained in years.

@alerque
Copy link
Collaborator

alerque commented Jul 29, 2024

Also as one of the last maintainers of this, I can say I have no current interest in it. Stack Exchange has long since ceased to be the community oriented effort it once was and now organizes entirely around what the parent company can make a buck off of. I'm always interested in collaborating with people on things that mutually benefit each other but have no interest in being manipulated and taken advantage of as a means of corporate profit. I still land on the site sometimes when searching for technical answers but have very little interest in contributing and will not be doing any development work on this for the foreseeable future. Others are welcome to fork and run with it but don't hold your breath for anything from me.

@IzzySoft
Copy link
Contributor

What @alerque said. I can only second this. I happily contribute to community projects to the benefit of all – but don't like to have my work exploited for single-sided profit. So like Caleb, I mostly stopped contributing there.

@Benjol
Copy link
Owner

Benjol commented Jul 29, 2024

@alerque & @IzzySoft said out loud what I omitted, because the main reason I can't help you is that I'm totally out of touch with the plugin. The reason for me being out of touch is what they said.

Sorry @L0Lock.

@cellio
Copy link

cellio commented Jul 29, 2024

I also left SE when their mistreatment of contributors became too much to bear. I joined the Codidact project to build a community-first platform that's FOSS and protected by a non-profit org (so it legally cannot go the way SE did). We're small but trying to grow -- see my GitHub profile for repos/links if interested. I don't want to be spammy; if anyone finds this comment objectionable, please let me know and I'll delete it. (It sounded like some of you might be interested.)

@L0Lock
Copy link

L0Lock commented Jul 29, 2024

I understand, no worries. Thanks for your commitment and your hard work so far.

Maybe this could be clearly stated on the readme, and/or the repo archived, just for good communication measure.

And I'll sure check your repos @cellio ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants