Interact with DOM node via a contextmenu entry

WebExtensions unfortunately doesn’t implement anything equivalent to Add-on SDK’s SelectorContext. I was able to hack something equivalent using HTML5’s <menu type="context"> feature (which works on Firefox but not on Chromium). My implementation of it starts here. Admittedly it’s not very readable. Basically it’s a text highlighter add-on. The hiliteNode function wraps each marked text node in a <span class="prostetnic" contextmenu="prostetnic-###"> element. It then creates a context menu for each such span. This HTML5 context menu appears separately from the WebExtensions context menu, which is confusing. It’s the best I could do, that I’ve figured out so far, anyway. Yeah, I miss SDK.