Hacker News new | ask | show | jobs
by ytugiuyghvk 3411 days ago
Same here. Is the Lookupbar (Alt+Del) possible to do with WebExtensions? I think it would have to be recreated in the DOM and inserted into the web page.
1 comments

There's nothing difficult or complex (or unsupported) about inserting content into web pages. The main limitation of webextensions is that free-form UI modification is no longer possible, the UI can only be modded in specific, allowed ways.
No, but there are several reasons it is suboptimal here.

The lookupbar is associated with the window chrome (ie. there is one per window). Inserting it into the DOM requires emulating this behavior by synthesizing one "bar" in each tab, adding and deleting them at the right time, etc.

Inserted content always has the possibility of interacting poorly with the scripts and styles of the underlying page (or other extensions). Rikai-chan already has problems where its overlays will end of underneath page content.

Inserted content goes below the line of death (https://textslashplain.com/2017/01/14/the-line-of-death/). There are other minor deficiencies: you can't get the browser's theme on the bar, etc.

For Rikai-chan, it seems like it'd be nice to allow the background script to write to a page that sits on top of the space that shows the actual page and have the content scripts communicate what should be rendered. AFAIK, the only ways to show something on the screen is to either send it to the content scripts and have them modify the DOMs, or show it in a popup for a button.