mozilla / security-advisor-shield-study

Mozilla Public License 2.0
2 stars 7 forks source link

Back button doesn't remove the URL bar button #21

Closed Osmose closed 8 years ago

Osmose commented 8 years ago

If I click a link that points to a domain that will show the button (like LinkedIn), and then click the back button (or any of the other shortcuts for going back), the button in the URL bar is not removed.

As a side note, it kinda seems like we should make a library for dispatching events when the user is viewing and leaving pages matching certain domains. Not only do we have two studies doing this, but we've had similar bugs between them with regards to catching all the different events that lead to a page being shown and hidden. Something to keep in mind for the next URL-matching study (a common rule of thumb is that you should write a library the third time you find yourself doing the same thing in different projects).

Osmose commented 8 years ago

Huh, I can't replicate this with the link above, but I am able to replicate it with the article link on https://news.ycombinator.com/item?id=12327350.

casebenton commented 8 years ago

I'm able to replicate it as well with the LinkedIn link. I think that I've figured out the issue: currently I'm using the sdk/tabs "activate" and "ready" event listeners, and neither will emit when a page is retrieved from the cache upon clicking the back button. Looks like I should be using "pageshow" instead of "ready".

As for creating a library, I agree that it's a good idea. Should I also make a library for url-bar icons?

Osmose commented 8 years ago

As for creating a library, I agree that it's a good idea. Should I also make a library for url-bar icons?

Yeah. Actually, @rhelmer was recently talking about a way to add new capabilities to Web Extensions. It might be interesting to see if we could package up the url-bar icon pattern like that; then we could potentially be writing web extensions for our studies instead of full add-ons.