Closed raszpl closed 2 months ago
well, it is a good idea, but https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Sharing_objects_with_page_scripts means we get exception in FF (and no idea about Safari), requires cloneInto(). Ill ponder about it some more later. edit: this is enough to make Firefox happy:
if (typeof cloneInto == 'function') {
message = cloneInto(message, window);
}
but this would need testing under Safari first.
hi! :)
figured why it was done like this? /any possible advantage
safari: can build with xcode and run unsigned. looking forward to have a new appstore subscription
figured why it was done like this? /any possible advantage
DOM manipulation is slow and you need to encode stuff so it doesnt get mangled in transit, huge disadvantages. Proper messaging might look too complicated to bother, and compatibility might not have been great at the time.
Hmm Iv been trying to use events for message passing because that removes the need for json encoding (can pass raw objects inside .detail), but maybe proper way is to just use normal messaging https://developer.chrome.com/docs/extensions/develop/concepts/messaging Its compatible with all browsers. Will try that next.
safari: can build with xcode and run unsigned
I like the ease of live editing unpacked extensions. Building/packing every small change sucks :(
Need someone with Safari browser to test this patch. Sadly I dont even know if its possible to load unpacked extension in recent (5 years) Safari as apparently Apple removed Developer mode?!?!