Овај сајт ће имати ограничену функционалност док га будемо ажурирали у циљу побољшања вашег искуства. Ако неки чланак не реши ваш проблем и желите да поставите питање, на располагању ће вам бити наше заједнице подршке @FirefoxSupport на Twitter-у и /r/firefox на Reddit-у.

Претражи подршку

Избегните преваре подршке. Никада од вас нећемо тражити да зовете или шаљете поруке на број или да делите личне податке. Пријавите сумњиве радње преко „Пријавите злоупотребу” опције.

Сазнај више

Archive.is, Wayback Machine bookmarklets don't work on Twitter.com

  • 6 одговорa
  • 1 има овај проблем
  • 1 преглед
  • Последњи одговор послао DoesNotEqual14

more options

I have two bookmarklets for archiving webpages: They work on the vast majority of websites, including those using https. But for some reason, they don't work on Twitter.com: Clicking the bookmarklets doesn't do anything with a Twitter tab in focus.

What's even stranger is that it doesn't seem to be an issue with Twitter itself, as I have used these bookmarklets in other browsers such as Opera, Chrome, Brave, Edge, and Pale Moon and they all worked fine with Twitter. So the bookmarklets only fail to work on Twitter while using Firefox.

I had this issue in older versions of Firefox and it seems to have persisted in FF Quantum. Any idea what the problem could be?

I have two bookmarklets for archiving webpages: They work on the vast majority of websites, including those using https. But for some reason, they don't work on Twitter.com: Clicking the bookmarklets doesn't do anything with a Twitter tab in focus. What's even stranger is that it doesn't seem to be an issue with Twitter itself, as I have used these bookmarklets in other browsers such as Opera, Chrome, Brave, Edge, and Pale Moon and they all worked fine with Twitter. So the bookmarklets only fail to work on Twitter while using Firefox. I had this issue in older versions of Firefox and it seems to have persisted in FF Quantum. Any idea what the problem could be?
Приложени снимци екрана

Измењено од стране DoesNotEqual14

Изабрано решење

You could create a new one that is more similar to the working one and see whether that makes a difference:

Wayback New Tab: javascript:void(window.open('http://web.archive.org/save/' + location.href))

Прочитајте овај одговор са објашњењем 👍 1

Сви одговори (6)

more options

I suspect the issue is CSP, which is short for Content Security Policy. CSP is a set of instructions sites can give browsers about which sources of content to trust. If the site does not allow 'unsafe-inline' as a script source, then Firefox will block bookmarklets from running on the page. Apparently browsers are not supposed to do that, but this has been in the bug tracking system for a very long time and who knows when it will be fixed.

As a workaround, you could try this extension:

https://addons.mozilla.org/firefox/addon/bookmarklets-context-menu/

It adds a little flyout menu to the bottom of the context menu for the page body that provides lists of your bookmarklets on the Bookmarks Menu and Bookmarks Toolbar. This seems to bypass CSP using the different privileges that extensions have. However, it does require some serious permissions, so that's a consideration if you have an alternate workaround.

more options

This allows the archive.is bookmarklet to work! However, it seems to break the Wayback bookmarklet. It's a decent workaround because I can still use it from the toolbar for other sites, but ultimately just a partial fix.

jscher2000 said

I suspect the issue is CSP, which is short for Content Security Policy. CSP is a set of instructions sites can give browsers about which sources of content to trust. If the site does not allow 'unsafe-inline' as a script source, then Firefox will block bookmarklets from running on the page. Apparently browsers are not supposed to do that, but this has been in the bug tracking system for a very long time and who knows when it will be fixed. As a workaround, you could try this extension: https://addons.mozilla.org/firefox/addon/bookmarklets-context-menu/ It adds a little flyout menu to the bottom of the context menu for the page body that provides lists of your bookmarklets on the Bookmarks Menu and Bookmarks Toolbar. This seems to bypass CSP using the different privileges that extensions have. However, it does require some serious permissions, so that's a consideration if you have an alternate workaround.
more options

Any obvious difference between the two bookmarklets that might explain why one works and one doesn't?

more options

Here are the scripts for each one:

Archive.is: javascript:void(open('https://archive.is/?run=1&url='+encodeURIComponent(document.location)))

Wayback Machine: javascript:location.href='http://web.archive.org/save/'+location.href

jscher2000 said

Any obvious difference between the two bookmarklets that might explain why one works and one doesn't?
more options

Одабрано решење

You could create a new one that is more similar to the working one and see whether that makes a difference:

Wayback New Tab: javascript:void(window.open('http://web.archive.org/save/' + location.href))

more options

It works! Thank you!