Hacker News new | ask | show | jobs
by ytugiuyghvk 3404 days ago
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.