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

Options page doesn't appear in Firefox #369

Closed
samestep opened this issue Aug 10, 2016 · 10 comments
Closed

Options page doesn't appear in Firefox #369

samestep opened this issue Aug 10, 2016 · 10 comments

Comments

@samestep
Copy link

I'm using Firefox 48.0 on Ubuntu 16.04.1 LTS.

I installed Markdown Here in Thunderbird yesterday, and it seems to be working perfectly. I can go to the Add-ons Manager and click Preferences next to the Markdown Here extension, which brings me to the Markdown Here Options page as expected.

Today, I tried to set up Markdown Here in Firefox. I downloaded it from here, installed it, and restarted Firefox. If I remember correctly. after Firefox restarted, it opened a new tab with the Markdown Here Options page, which I closed because I assumed that I would be able to navigate back to that page later. However, when I go to the Add-ons Manager in Firefox and click Preferences next to the Markdown Here extension, nothing happens. I've since reinstalled Markdown Here and rebooted my computer several times, to no effect.

Is there a way to fix this? If not, is there another way to access the Markdown Here Options page in Firefox that I can use as a workaround?

@samestep
Copy link
Author

I've discovered another strange behavior. I've configured Firefox to not remember history, and to clear cookies when I close Firefox. For instance, if I open Firefox, log into Stack Exchange, then close and reopen Firefox, I will no longer be logged into Stack Exchange.

After I install Markdown Here, this behavior remains the same. But after I click the nonfunctioning Preferences button as mentioned above, if I log into a website such as Stack Exchange, then close and reopen Firefox, Firefox reopens much more quickly than before, and I remain logged into that website.

This behavior persists until I Disable and then Enable the Markdown Here extension, but it reappears as soon as I click the Preferences button again. Is this issue in any way related to the fact that the Preferences button doesn't work?

@samestep
Copy link
Author

I reinstalled Firefox, then installed Markdown Here again. As before, the Markdown Here Options page appeared once after I restarted Firefox. I saved its location this time, so now at least I have one way to access the Options page: resource://markdown_here_common/options.html

The problems with the Preferences button in the Add-ons page still persist.

@spacepluk
Copy link

spacepluk commented Aug 15, 2016

I'm also experiencing this. Thanks for the link.

@j-h-a
Copy link

j-h-a commented Oct 25, 2016

Same thing here. Came here looking for the resource:// link because I couldn't remember it and for some reason it wasn't in my history. So thanks for that.

@l0o0
Copy link

l0o0 commented Feb 23, 2017

Firefox 51.0.1 (64-bit) in Ubuntu 16.10 has this problem too.

@juaalta
Copy link

juaalta commented Feb 23, 2017

The problem is that the plugin does not support multiprocess.
In order to use the plugin you have to disable it.

@samestep
Copy link
Author

samestep commented Feb 23, 2017

@juaalta What do you mean? When I go to about:support, "Multiprocess Windows" is listed as "0/1 (Disabled by add-ons)", yet the Preferences button still doesn't work. Also, other than the Preferences button, the plugin works perfectly fine. And the Thunderbird version of the plugin doesn't have this problem at all.

@juaalta
Copy link

juaalta commented Feb 27, 2017

In this version I have not tried it, but until the previous version if you had disabled the windows multiprocess this screen worked.

@adam-p
Copy link
Owner

adam-p commented May 30, 2017

(Just realized I never actually commented on this issue...)

The fix for this problem has been committed (5308e78). It'll be released "soon". I'm trying to do some coordination between updating the XUL-based extension and releasing the new WebExtensions-based extension.

Workaround for Firefox users: Uninstall MDH and re-install the WebExtensions-based on from here: https://addons.mozilla.org/en-US/firefox/addon/markdown-here/ (Note that it's not fully Mozilla-reviewed at the time I'm writing this.)

Workaround for Thunderbird users: Open Tbird's error console (ctrl+shift+j, cmd+shift+j), then paste this into the eval field:

Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('mail:3pane').document.getElementById('tabmail').openTab('contentTab', {contentPage: 'resource://markdown_here_common/options.html'})

Here's what broke...

For XUL-based extensions, Firefox and Thunderbird figure out what to do when the user clicks the "Options" button by looking in install.rdf at the optionsURL field. In order to open a new tab with a HTML page for options, I used a JavaScript in the field, instead of a plain URL. So it looked like this:

<em:optionsURL>
    javascript:
        /* This is a pretty convoluted way of getting a tab to open with
            our options page. */
        var windowMediator = Components.classes['@mozilla.org/appshell/window-mediator;1']
                                        .getService(Components.interfaces.nsIWindowMediator);
        var optionsUrl = 'resource://markdown_here_common/options.html';
        if (navigator.userAgent.indexOf('Thunderbird') >= 0 ||
            navigator.userAgent.indexOf('Icedove') >= 0) {
            windowMediator.getMostRecentWindow('mail:3pane')
                            .document.getElementById('tabmail')
                            .openTab('contentTab', {contentPage: optionsUrl});
        }
        ...et cetera...
</em:optionsURL>

That worked totally fine until around Firefox/Tbird v49. At that point any JavaScript in that field caused the client to hang.

...Which is pretty crappy. I mean, maybe I shouldn't have been using JS there (although I'm sure I didn't invent the technique), but hanging the whole app? Anyway, Firefox is rapidly moving away from XUL-based extensions, so I'm sure they don't care.

The fix is not sexy. optionsURL is now set to a XUL dialog, which does one thing: execute the same JavaScript in order to open the tab. Like so:
image

@drjackyl
Copy link

Thanks a lot for the fix.

I think I searched for Thunderbird and "settings", rather than options. However I didn't find this issue here to confirm it for Thunderbird and created a new one, so: sry for the duplicate.

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

7 participants