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

Can't save setting in FF67 #25

Closed
ooker777 opened this issue Apr 10, 2019 · 14 comments
Closed

Can't save setting in FF67 #25

ooker777 opened this issue Apr 10, 2019 · 14 comments

Comments

@ooker777
Copy link

I try this:

with and without checking Create submenus, but it resets after saved. The panel is blank:

@scruss
Copy link

scruss commented Apr 20, 2019

Same for me, FF 66.0.3 on Ubuntu 19.04 x86_64

@scivola
Copy link

scivola commented Apr 24, 2019

Same for me, FF 66.0.3 on macOS 10.13.6.

@scivola
Copy link

scivola commented May 7, 2019

Now it works.
(from Firefox 66.0.4 ?)

@scivola
Copy link

scivola commented May 9, 2019

It does not work, again. (same as @ooker777)
Firefox 66.0.5, macOS 10.13.6

@scruss
Copy link

scruss commented Jun 4, 2019

broken again

FF 67.0 (Ubuntu), Format Link 3.0.1

@akabekobeko
Copy link

It seems to occur when create a new environment. I commented that on #20.

@mavensecurity
Copy link

Ditto -It does not let you save settings; there are no default settings; It does nothing at this point. Format Link v3.0.1 in FF 64.0.4 Windows

@scruss
Copy link

scruss commented Jul 2, 2019

Oddly, I have one Firefox instance where FormatLink does still work perfectly: Firefox 67.0.4, Windows 10, FormatLink v3.0.1 (May 7, 2019 - automatic updates set to Default rather than On). I wish I knew where the difference was between this and my other installations that don't work.

@lo48576
Copy link

lo48576 commented Oct 13, 2019

Reproduced in Firefox 70.0b14 (64-bit).

I checked stderr log of /usr/bin/firefox, and found that the lines below are logged when I pushed "Save changes" button.

console.warn: LoginRecipes: "getRecipes: falling back to a synchronous message for:" "moz-extension://feae02b2-7613-4beb-bc87-40e07046d63c"
WARNING: content window passed to PrivateBrowsingUtils.isWindowPrivate. Use isContentWindowPrivate instead (but only for frame scripts).
pbu_isWindowPrivate@resource://gre/modules/PrivateBrowsingUtils.jsm:27:11
isBrowserPrivate@resource://gre/modules/PrivateBrowsingUtils.jsm:47:19
fire@resource://gre/modules/WebNavigation.jsm:553:30
onDocumentChange@resource://gre/modules/WebNavigation.jsm:508:10
receiveMessage@resource://gre/modules/WebNavigation.jsm:377:14
WARNING: content window passed to PrivateBrowsingUtils.isWindowPrivate. Use isContentWindowPrivate instead (but only for frame scripts).
pbu_isWindowPrivate@resource://gre/modules/PrivateBrowsingUtils.jsm:27:11
isBrowserPrivate@resource://gre/modules/PrivateBrowsingUtils.jsm:47:19
fire@resource://gre/modules/WebNavigation.jsm:553:30
onDocumentChange@resource://gre/modules/WebNavigation.jsm:508:10
receiveMessage@resource://gre/modules/WebNavigation.jsm:377:14
WARNING: content window passed to PrivateBrowsingUtils.isWindowPrivate. Use isContentWindowPrivate instead (but only for frame scripts).
pbu_isWindowPrivate@resource://gre/modules/PrivateBrowsingUtils.jsm:27:11
isBrowserPrivate@resource://gre/modules/PrivateBrowsingUtils.jsm:47:19
fire@resource://gre/modules/WebNavigation.jsm:553:30
onLoad@resource://gre/modules/WebNavigation.jsm:527:10
receiveMessage@resource://gre/modules/WebNavigation.jsm:385:14
JavaScript error: moz-extension://feae02b2-7613-4beb-bc87-40e07046d63c/common.js, line 29: TypeError: invalid assignment to const `options'

It seems that the line 27 of common.js should be let options = ... instead of const options = ... (because it could be rewritten at line 29).

const options = await browser.storage.sync.get(null);
if (Object.keys(options).length === 0) {
options = DEFAULT_OPTIONS;

EDIT: There have already been a PR to fix this: #28.

@lo48576
Copy link

lo48576 commented Oct 13, 2019

Quick workaround

  1. Open about:debugging#/runtime/this-firefox.
    • type this in location bar and press Enter key.
  2. Push "Inspect" button for "Format Link" extension.
    • It exists in "Extensions" section.
    • This opens developer console, with extension scripts loaded.
  3. Select "Console" tab of developer console, type await browser.storage.sync.set(DEFAULT_OPTIONS);, and press Enter key.
    • DEFAULT_OPTIONS is defined at line 3 of common.js.
      const DEFAULT_OPTIONS = {
      "defaultFormat": "1",
      "title1": "Markdown",
      "format1": "[{{text.s(\"\\\\[\",\"\\\\[\").s(\"\\\\]\",\"\\\\]\")}}]({{url.s(\"\\\\)\",\"%29\")}})",
      "title2": "reST",
      "format2": "`{{text}} <{{url}}>`_",
      "title3": "Text",
      "format3": "{{text}}\\n{{url}}",
      "title4": 'HTML',
      "format4": "<a href=\"{{url.s(\"\\\"\",\"&quot;\")}}\">{{text.s(\"<\",\"&lt;\")}}</a>",
      "title5": "LaTeX",
      "format5": "\\\\href\\{{{url}}\\}\\{{{text}}\\}",
      "title6": "",
      "format6": "",
      "title7": "",
      "format7": "",
      "title8": "",
      "format8": "",
      "title9": "",
      "format9": "",
      "createSubmenus": false
      };
    • This statement forcibly saves the default settings to internal storage for "Format Link" extension.
    • This makes Object.keys(options).length non-zero at line 28 of common.js. Line 29 won't be executed and you will have no error.
      if (Object.keys(options).length === 0) {
  4. Now you will see default settings are saved in about:addons.
    You can modify and save custom settings.

By this workaround, the extension started to work as expected in my environment.

@nopoz
Copy link

nopoz commented Apr 2, 2020

Quick workaround

1. Open `about:debugging#/runtime/this-firefox`.
   
   * type this in location bar and press Enter key.

2. Push "Inspect" button for "Format Link" extension.
   
   * It exists in "Extensions" section.
   * This opens developer console, with extension scripts loaded.

3. Select "Console" tab of developer console, type `await browser.storage.sync.set(DEFAULT_OPTIONS);`, and press Enter key.
   
   * `DEFAULT_OPTIONS` is defined at line 3 of `common.js`.
     https://github.com/hnakamur/FormatLink-Firefox/blob/3291a7c0715e6a0a50a37433222b350759731940/common.js#L3-L24
   * This statement forcibly saves the default settings to internal storage for "Format Link" extension.
   * This makes `Object.keys(options).length` non-zero at line 28 of `common.js`. Line 29 won't be executed and you will have no error.
     https://github.com/hnakamur/FormatLink-Firefox/blob/3291a7c0715e6a0a50a37433222b350759731940/common.js#L28

4. Now you will see default settings are saved in `about:addons`.
   You can modify and save custom settings.

By this workaround, the extension started to work as expected in my environment.

I don't understand this workaround - what am I supposed to be changing? Using FF74, I can't save any settings.

@lo48576
Copy link

lo48576 commented Apr 2, 2020

@nopoz You are supposed to change (initialize) the internal storage of FormatLink addon.

Currently FormatLink has a bug and it cannot initialize its internal storage through plugin's usual setting page.
As a workaround for this, you can initialize the storage manually not by plugin's setting page, but by directly running a program to do that.

The workaround above is a procedure for doing manual initialization of the storage.

@hnakamur
Copy link
Owner

Sorry for being late, I added the fix as commented at #25 (comment) and published version 4.0.2.
Could you upgrade to the latest version?
Thanks!

@hnakamur
Copy link
Owner

hnakamur commented Sep 1, 2022

Sorry for not responding. I'm closing this since it's too old.

@hnakamur hnakamur closed this as completed Sep 1, 2022
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

8 participants