Closed miketaylr closed 7 years ago
Note: you can test this by going to about:debugging and from "Load Temporary Add-on" select bootstrap.js.
Let me explain the basic architecture:
init()
we create a button widget, inject a stylesheet to control its icon, place it in the panel, and set up listeners. two kinds of special listeners: 1) a window listener, so we can attach listeners to new windows 2) tab listener: so we know if either a) a new tab was opened or b) a tab was selected. We need to know this so we can enable or disable the button -- we only want it to be possible for webby URLs to be reported (i.e., not about:, file:, chrome:, etc. URIs).window.postMessage()
w/ that so the bugform.js on webcompat.com can handle it (do validation, shrink it if necessary, make a preview, etc.) Oops, lost some fixup commits when rebasing!
ok @denschub -- ready for another round!
I can install it, but when I restart the browser, I hit that exception
Ah, that's the missing STR. Thanks!
OK, @denschub, made some tweaks and have uploaded latest to https://miketaylr.com/tmp/reporter.html. Whatcha think?
(note: I did just find a bug that i'm not removing all tab listeners when you uninstall the add-on. i'm not super worried about that, but will come up with something tomorrow).
Last commit fixed the uninstall bug. r? @denschub
Totally forgot that this version doesn't add the context menu stuff, but that can be a different bug. :)
TODO:
X-Reported-With
headerremove pref-setting and use all.js when I prep this for m-c(removing that TODO, because it's not really relevant to this PR)r? @denschub
(My plan here is to incorporate any/all review feedback from Dennis before submitting patches in Bugzilla to get merged into moz-central -- I suppose this is a weird way around a feedback? request!)