WordPress / playground-tools

GNU General Public License v2.0
127 stars 38 forks source link

Edit Visually browser extension – iteration 2 #298

Open adamziel opened 3 weeks ago

adamziel commented 3 weeks ago

🚧 A more involved description TBD 🚧

Large changes:

cc @dmsnell

brandonpayton commented 2 weeks ago

I made a note to poke at this tomorrow. I'd love to see more of what you've done here.

Manifest v3 makes the iframe non-feasible. An external domain with a loopback service worker is used to work around Manifest v3 limitation

What is this limitation?

Extension service worker is involved, which breaks Firefox compat (not sure about Safari)

It is probably possible to use the older background page approach for a manifest v3 Firefox extension, once you are happy with the Chrome version.

Also, IIRC, the offscreen document being used here was created to fill a gap that was left when Chrome switched away from background pages, so I wonder whether the background page in Firefox could serve in the same way. (Or perhaps Firefox also has support for offscreen documents).

adamziel commented 2 weeks ago

What is this limitation?

@brandonpayton tl;dr, you either can't eval() and use inline <script> tags on content served from the extension, or, when using a "sandbox" page, you can't have a service worker.

A fuller answer is on these diagrams I drawn while exploring different avenues:

where to run Playground


scene


scene