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

Save tab set feature not working #10

Open
pyrho opened this issue Jan 19, 2020 · 24 comments
Open

Save tab set feature not working #10

pyrho opened this issue Jan 19, 2020 · 24 comments

Comments

@pyrho
Copy link

pyrho commented Jan 19, 2020

Hi,

First thanks for this extension, I've been using it daily for the past few years.

The "Save tab set" feature is not working for me, I think it used to work (that is not a feature I use a lot).

I've checked in the debugger and the proper POST request is made to pinboard.in/tabs/save, the request content looks good too, and the server replies with a happy 200 [1].

The code in the save_tab_set function executes without errors until the end too and opens up the pinboard.in/tabs/show URL correctly, but once there nothing is shown I just have an empty page.

This may be an issue with pinboard itself, I will try to contact their support too.

1: Screenshot 2020-01-19 at 02 35 23

@gapop
Copy link
Owner

gapop commented Jan 19, 2020

I have just tested with Firefox 72.0.1 on Ubuntu and with Nightly on Windows, and I couldn't reproduce it. It's possible that it was a temporary glitch at Pinboard, the server can be slow sometimes.

If you investigate this further, please take a look at the request Params tab in the debugger shown in your screenshot, to see what the tab data sent to Pinboard looks like.

@pyrho
Copy link
Author

pyrho commented Jan 19, 2020

Still no luck on my end :(
Here is the content of the Params tab:

-----------------------------20632523916696856151237315956
Content-Disposition: form-data; name="data"

{"browser":"ffox","windows":[[{"title":"Home | Last.fm","url":"https://www.last.fm/home"},{"title":"Pinboard - antisocial bookmarking","url":"https://pinboard.in/tabs/show/"},{"title":"Add-ons Manager","url":"about:addons"},{"title":"Toolbox - Extension / Pinboard WebExtension","url":"about:devtools-toolbox?type=extension&id=pinboard-webextension%40helloworld.ro"},{"title":"Pinboard - antisocial bookmarking","url":"https://pinboard.in/tabs/show/"},{"title":"Save tab set feature not working · Issue #10 · gapop/pinboard-webextension","url":"https://github.com/gapop/pinboard-webextension/issues/10#issuecomment-575997456"}]]}
-----------------------------20632523916696856151237315956--

Looks legit.

I'm running Firefox 72.0.1 macOS.

@gapop
Copy link
Owner

gapop commented Jan 19, 2020

I have tested with Firefox 72.0.1 on macOS High Sierra (10.13.6). Couldn't reproduce it. I even tried with your payload in the debugger and it worked fine. You could try doing the operation in a fresh Firefox profile, to see if it's not something related to the browser's cache, settings or other extensions. Sorry, I don't know what else to suggest.

@pyrho
Copy link
Author

pyrho commented Jan 19, 2020

Thanks for looking into it, I am also lost regarding this issue.
Will keep you posted if I ever find out what the issue is, in any case I don't think the issue is with the extension.

@pyrho pyrho closed this as completed Jan 19, 2020
@tjharman
Copy link

I experience this too, did you find a solution @pyrho?

@gapop
Copy link
Owner

gapop commented Apr 21, 2020

@tjharman, can you reproduce it reliably? Have you tried with a new Firefox profile, no other addons or custom settings? I don’t have ready access to a Mac, but I did test this when first reported and couldn’t reproduce it at all. From pyrho's description, it doesn’t look like the extension is causing this problem.

@gapop
Copy link
Owner

gapop commented Apr 23, 2020

Check out this Twitter thread: https://twitter.com/srtcd424/status/1253015359143251968

It is likely related to the problem you’ve been seeing.

@tjharman
Copy link

Thanks I'll wait and see what happens. Agree it does look like a pinboard problem!

@pyrho
Copy link
Author

pyrho commented Apr 23, 2020

@tjharman sorry no, I contacted pinboard support months back (when I first opened this issue), bumped the mail a few times but never got an answer.... :/

@tjharman
Copy link

Hi just to close this off - I have tested again this morning and it's working for me.

Thanks all.

@pyrho
Copy link
Author

pyrho commented Apr 28, 2020

Still no luck for me :(
Did you do something special ?

@gapop
Copy link
Owner

gapop commented May 13, 2020

Hey, @pyrho, I only now have noticed in the screenshot you have provided that your browser doesn’t send the Pinboard cookies in that POST request. It should send at least two cookies, login and auth. That explains why saving tab sets doesn't work for you. The request to /tabs/save/ sends your tab data to Pinboard, where it’s stored in your session, then /tabs/show/ shows whatever tab data is in your session and allows you to save it.

I have no idea why your browser is not sending the Pinboard cookies. I will investigate this further. If you can think of anything that might cause this, please let me know.

@pyrho
Copy link
Author

pyrho commented May 13, 2020

@gapop thanks so much for (still) looking into this issue :)
You are right, that seems to be the cause of the issue.
The groznax cookie is the only one being sent with the request (thanks to fetch being called with credentials: 'include').

I have 6 cookies for pinboard, but only the groznax one is being sent.
I'm guessing it's because groznax is the only cookie that's for pinboard.in, all the others (including auth and login) are for .pinboard.in (note the leading .).

I tried messing with cookie/privacy related settings in FF to no avail.

Here is the output of about:config with all *cookie* related settings in case it is of any help:

Screenshot 2020-05-13 at 22 45 24

@gapop
Copy link
Owner

gapop commented May 13, 2020

It’s really weird. The domain name with a leading dot does not explain it. It’s actually more permissive.

A few questions, not that I suspect anything in particular:

  • Do you have any custom permissions for pinboard.in (see attached screenshot)?
  • Do you have any extensions that might be messing with cookies?
  • Do you normally stay logged in to Pinboard or do you login every day?
  • Do you use containers in Firefox? Is Pinboard assigned to a special container?

pinboard-custom-settings

@pyrho
Copy link
Author

pyrho commented May 17, 2020

Do you have any custom permissions for pinboard.in (see attached screenshot)?

I don't, it says "You have not granted this site any special permissions"

Do you have any extensions that might be messing with cookies?

I have uBlock, but I don't think it acts on cookies.

Do you normally stay logged in to Pinboard or do you login every day?

I'm always logged in to it.

Do you use containers in Firefox? Is Pinboard assigned to a special container?

Yes, but pinboard is not assigned to one.

A while back I did mess with the cookie settings via about:config that might be the reason :/

I'll try with a fresh FF install see if I still have the issue, that would settle it.

edit: formatting

@pyrho
Copy link
Author

pyrho commented May 17, 2020

It's totally working with a fresh FF install, so I definitely messed something up with my current setup, will keep you posted if I ever find the cause.
Thanks again for your help!

@pyrho
Copy link
Author

pyrho commented May 18, 2020

Found the culprit after diffing the prefs.js file located in my profile folder against the one from a fresh install.

privacy.firstparty.isolate defaults to false and was set to true in my case.

@tjharman
Copy link

tjharman commented May 18, 2020

@pyrho Do you have anything else odd set? I have that (privacy.firstparty.isolate=true) set and I'm not having problems with saving tabsets.

@gapop
Copy link
Owner

gapop commented May 18, 2020

I experimented with the privacy.firstparty.* settings and cannot reproduce it, although it looks like they could play a role in a more complex scenario. Anyway, if you were able to fix it for yourself, that’s great!

@ChrisDavison
Copy link

Despite this issue being closed, just wanted to 👍 the suggestion for privacy.firstparty.isolate. Reseting this to false within about:config fixed the no-tabset issue for me. May not work for all (as @gapop says), but worth trying.

@rubaboo
Copy link

rubaboo commented Feb 1, 2021

Confirming, privacy.firstparty.isolate = false is the way to get tab sets working again. BTW, that is the master switch, when it's false, other privacy.firstparty.* prefs don't matter. @gapop if you were to try again, I don't know for sure but it could be that network.cookie.cookieBehavior has to be set to 4 in order to reproduce the issue. The sure way to reproduce (tested in a new profile) is to add https://github.com/arkenfox/user.js to your profile. Any chance you could reopen this issue and see if you can make "Save tab set" work with FPI on?

@gapop
Copy link
Owner

gapop commented Feb 1, 2021

@rubaboo, thanks for your feedback. By my current understanding of how FPI works, I don't think my extension could be made to work with that feature enabled. Rather than using Pinboard’s API, the extension is designed to load pages – the login form, the Save Bookmark form etc. – directly from Pinboard, just like the old official Firefox extension. This preserves the Pinboard experience and completely avoids exposing credentials and other account data to the extension, but it does require the browser to be able to send the Pinboard login cookie for most extension actions. I think FPI prevents exactly this.

I will keep in mind the information you’ve provided and I’ll try to find a way, but I don’t want to give you false hope. If you want to use FPI, you will likely be better off with some other extension that uses the Pinboard API.

@gapop gapop reopened this Feb 1, 2021
@gapop
Copy link
Owner

gapop commented Feb 1, 2021

I do not understand this issue at all.

I was able to reproduce it in a new profile by simply setting privacy.firstparty.isolate to true – something that didn’t work in my regular profile. I’ve checked network.cookie.cookieBehavior, it was 4 (apparently the default). The only thing of note about the cookies is what @pyrho mentioned above: the authentication cookies use a different hostname: .pinboard.in, as opposed to pinboard.in for the other cookies. Most extension actions worked, but Save Tabs did not. On one occasion, Read Later also didn’t work. Monitoring what cookies are being sent with each request did not result in a clear picture. The developer tools seemed to be as confused as this developer.

After a few login/logout maneuvers and toggling the isolate flag, I cannot reproduce it anymore, regardless of the isolate value. I did not change any other browser setting.

As a possible workaround for affected users, try logging in and out of Pinboard both with privacy.firstparty.isolate set to true and with it set to false. That seemed to make it go away for me.

I will leave this open and will dig some more when I get a chance.

@rubaboo
Copy link

rubaboo commented Feb 1, 2021

The issue is 100% observable by toggling privacy.firstparty.isolate between true and false. When it's false and the feature works, the data that is successfully sent to pinboard.in stays there persistently, even between browser restarts and re-logins.
To reproduce:

  1. Set privacy.firstparty.isolate to false. Restart the browser. (That is if you are using a separate user.js for this. If not, close the browser, edit prefs.js, then start the browser.)
  2. Open a tab to https://pinboard.in and login.
  3. Try "Save tab set" - the page is populated as expected.
  4. Don't save and don't click anything else on that page. Just close the tab https://pinboard.in/tabs/show/ and don't navigate to it again other than by trying "Save tab set" in the later steps.
  5. Repeat Step 1 but settingprivacy.firstparty.isolate to true this time.
  6. Open a tab to https://pinboard.in (or use the tab from the previous session if it's restored). Login.
  7. Open a few new tabs and navigate to some sites (don't leave the tabs empty).
  8. Try "Save tab set" - the page you are now seeing is the old one. The newly opened tabs are not there.
  9. Resetting the page:
    9.1. Uncheck Window 1 and other windows if you have more.
    9.2. Click on your username to move away from the page. (not sure if this is necessary, don't want to retest just for this.)
    9.3. Close the tab https://pinboard.in/tabs/show/.
  10. Try "Save tab set" - the page is now empty.

Repository owner deleted a comment Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants