binaryage/chromex

Firefox (and other browser support) via browser extensions

Closed this issue · 2 comments

chromex was obviously built for Chrome extensions. I've successfully used it to build a chrome extension for my colleagues. Some of them, however, use Firefox (and some even IE/Edge).

Given the recent move towards a standardized set of browser extension APIs I was wondering how much work it would be to adapt chromex to support extensions for multiple browsers (specifically FF and IE).

Since there is already some compat, I tried using the chromex-sample in Firefox, but got this

Error: Assert failed: chrome-event  chrome_event_subscription.js:113:8
	chromex$chrome_event_subscription$make_chrome_event_subscription moz-extension://0d3117c8-89da-d748-b7aa-e12c727b3ce1/compiled/background/chromex/chrome_event_subscription.js:113:8
	chromex.ext.runtime.on_suspend_STAR_.cljs$core$IFn$_invoke$arity$variadic moz-extension://0d3117c8-89da-d748-b7aa-e12c727b3ce1/compiled/background/chromex/ext/runtime.js:1376:29
	chromex$ext$runtime$on_suspend_STAR_ moz-extension://0d3117c8-89da-d748-b7aa-e12c727b3ce1/compiled/background/chromex/ext/runtime.js:1317:8
	chromex_sample$background$core$boot_chrome_event_loop_BANG_ moz-extension://0d3117c8-89da-d748-b7aa-e12c727b3ce1/compiled/background/chromex_sample/background/core.js:511:1
	chromex_sample$background$core$init_BANG_ moz-extension://0d3117c8-89da-d748-b7aa-e12c727b3ce1/compiled/background/chromex_sample/background/core.js:535:8
	<anonymous>

i.e. failing:

chromex.chrome_event_subscription.make_chrome_event_subscription = (function chromex$chrome_event_subscription$make_chrome_event_subscription(chrome_event,listener,chan){
if(cljs.core.truth_(chrome_event)){
} else {
throw (new Error("Assert failed: chrome-event"));
}

would you be interested in supporting multiple browsers? I'd love to help out!

I'm sorry I'm not going to do that at this point. Currently I'm only interested in developing Chrome extensions.

btw. Not sure what that error is. You should be using source mapping to map stack traces back to cljs sources. I would guess it failed in this pre-condition (which internally uses asserts):

{:pre [chrome-event listener chan]}

Fair enough, wanted to ask :) I'll try to see if there are any easy wins. Thanks for the response.