[Fixed] NoScript breaks the bfcache/fastback cache on reddit

Ask for help about NoScript, no registration needed to post
Whatever

[Fixed] NoScript breaks the bfcache/fastback cache on reddit

Post by Whatever »

Steps to reproduce:

1. Go to the comments page of any reddit post (e.g. http://www.reddit.com/r/blog/comments/1 ... nts_posts/)
2. Fold any comment tree by clicking the [-] next to the commenter's name (note that reddit.com and redditstatic.com need to have script permissions for this to work)
3. Open any link in the same tab
4. Hit the back button

Expected result: The comments page is loaded from the bfcache, and the comment tree that was folded in step 2 remains folded.
Actual result: The comments page is reloaded completely, as can be verified by the fact that the folded comment tree is unfolded again.

This happens with both NoScript 2.6.3 and 2.6.4rc1. Disabling NoScript fixes the problem. Other than "Policy is not defined" (which I already reported in another thread), nothing is logged in the error console.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: NoScript breaks the bfcache/fastback cache on reddit

Post by Thrawn »

Are there other sites being used to handle the cache, perhaps? Which sites are being allowed/blocked on the NoScript menu?
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0
Whatever

Re: NoScript breaks the bfcache/fastback cache on reddit

Post by Whatever »

The same thing still happens when I set NoScript to allow all scripts, so it's not related to script permissions. Additionally, if I revert back to NS 2.6.2 (using the same settings), the bfcache works again.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
User avatar
therube
Ambassador
Posts: 7991
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: NoScript breaks the bfcache/fastback cache on reddit

Post by therube »

How do you determine if bfcache is being used or not?

I load The woman who lives here is almost 100 years old.
Collapse a thread.
Open NoScript Get It is the same window.
Set browser to "offline mode".
Back arrow to reddit & the page displays as expected (except that the thread is no longer collapsed).
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0 SeaMonkey/2.16a2
User avatar
therube
Ambassador
Posts: 7991
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: NoScript breaks the bfcache/fastback cache on reddit

Post by therube »

NoScript 2.6.2 preserves the state of the collapsed thread, where later versions do not, so that is different, but not sure how bfcache is playing in?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0 SeaMonkey/2.16a2
Whatever

Re: NoScript breaks the bfcache/fastback cache on reddit

Post by Whatever »

therube wrote:How do you determine if bfcache is being used or not?
therube wrote:NoScript 2.6.2 preserves the state of the collapsed thread, where later versions do not, so that is different, but not sure how bfcache is playing in?
That is how I determine if the bfcache is used or not. If it is used, the state of the DOM is saved when the page is hidden, so after hitting the back button the page will be shown again with the saved DOM state.
If you want more evidence: Run the following code in the web console on a reddit comments page and then navigate away:

Code: Select all

window.addEventListener("pagehide", function(e){console.log(e.persisted);}, false);
You'll notice that the console shows "false", which according to the MDN docs means that the bfcache is not used. Similarily, running

Code: Select all

window.addEventListener("pageshow", function(e){console.log("showing page", e.persisted);}, false);
before navigating away and back again does not produce any output. If the bfcache was used (e.g. without NoScript or with NoScript 2.6.2), it would log a message to the console.

I hope that's enough evidence for you.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
User avatar
Giorgio Maone
Site Admin
Posts: 9557
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript breaks the bfcache/fastback cache on reddit

Post by Giorgio Maone »

Does adding .reddit.com to your noscript.surrogate.popunder.exceptions about:config preference help?
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0
Whatever

Re: NoScript breaks the bfcache/fastback cache on reddit

Post by Whatever »

Yup, that seems to fix the problem.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
User avatar
Giorgio Maone
Site Admin
Posts: 9557
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript breaks the bfcache/fastback cache on reddit

Post by Giorgio Maone »

Whatever wrote:Yup, that seems to fix the problem.
OK, please restore the preference to its default settings and check latest development build 2.4.6.2rc1, thanks.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0
Whatever

Re: NoScript breaks the bfcache/fastback cache on reddit

Post by Whatever »

Yup, it's fixed. Thanks a lot!
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
Post Reply