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

browser.notifications is undefined #41

Open
diamond-lizard opened this issue Nov 2, 2018 · 1 comment
Open

browser.notifications is undefined #41

diamond-lizard opened this issue Nov 2, 2018 · 1 comment

Comments

@diamond-lizard
Copy link

I just installed the textern extension and did:

git clone --recurse-submodules https://github.com/jlebon/textern
cd textern
make native-install USER=1

I changed textern's "External editor" option to:

["/home/me/bin/emacs-in-new-xterm", "%s", "%l", "%c"]

and the shortcut to:

Ctrl+Shift+E

Then I restarted Firefox, and in a text form I typed Ctrl+Shift+E which only resulted in the letter "e" being typed in to the text form.

No editor started up, but Firefox showed this error:

JavaScript error: moz-extension://a4a4e86d-25ed-4f9b-adef-68194c24eda4/content.js, line 20: TypeError: browser.notifications is undefined

I am on Firefox 60.3.0esr (64-bit) on Gentoo Linux.

@diamond-lizard
Copy link
Author

diamond-lizard commented Nov 3, 2018

I don't know why, but if I wrap the code inside the with clause in textern.py's main() inside a try ... except, it works (in some places, at least). Here's the code:

def main():
    with INotify() as ino, TmpManager() as tmp_mgr:
        try:
            ino.add_watch(tmp_mgr.tmpdir, flags.CLOSE_WRITE)
            loop = asyncio.get_event_loop()
            loop.add_reader(sys.stdin.buffer, handle_stdin, tmp_mgr)
            loop.add_reader(ino.fd, handle_inotify_event, ino, tmp_mgr)
            loop.run_forever()
            loop.close()
        except Exception as e:
            raise e

Without this change, the behavior is as I described in my original issue report above. With the change, I've tested that this works here in this GitHub issue report text form, and in a text form on the old Reddit https://old.reddit.com/r/firefox/submit

But it still doesn't work in the new Reddit: https://www.reddit.com/r/firefox/submit

There it just prints "e" inside the text form when I hit Ctrl+Shift+e. It's as if it's not even recognizing that I'm sending the keystroke.

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

1 participant