bobbyrne01 / save-text-to-file-firefox

Firefox addon that saves highlighted text to a file.
https://addons.mozilla.org/firefox/addon/save-text-to-file/
GNU General Public License v3.0
94 stars 30 forks source link

Doesn't work on certain domains #103

Closed GrippenDynamik closed 3 years ago

GrippenDynamik commented 5 years ago

The add-on does not work on these domains: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts --> Note that content scripts are blocked on the following domains:

Reason: backgroundScript.js --> function saveTextToFile(info) { uses tabs.executeScript() to run this content script in the current tab: code: '(' + getSelectionText.toString() + ')()',

Question: Why use a content script at all? saveTextToFile(info) already has the selected text from the current tab. It's in info.selectionText

bobbyrne01 commented 3 years ago

@Dboingue @GrippenDynamik This is fixed in 4.2.4

https://addons.mozilla.org/firefox/addon/save-text-to-file/

Selecting Save Text to File, uses text from info.selectionText instead of a content script .. meaning the addon works for the listed domains now when using the context menu option.