Improve inject reliability on webkit
Description
In short, this leaves our injected script elements in the DOM while they're pending and being observed-by-a-mutation-observer, rather than appending-and-immediately-removing them.
Of course, we don't officially support every browser, but there are lots of ways to install web extensions. I've been running a dev branch of XKit Rewritten in Safari for a few days and sometimes (often) things just wouldn't load. This seems? to help? I'll have to do more testing to be sure. Haven't had any problems once I made this change, though.
(Frankly I'm even less sure how the old way could lead to inconsistent behavior—surely it should either always work or never work, unless there's some window of n milliseconds in which Webkit still registers event listeners on things removed from the DOM? Yeah, no idea. Something with garbage collection? In any case, I do think the change makes semantic sense.)
Aside: now I'm extremely curious if #920 works.
Testing steps
- confirm basic functionality