Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Create a WebExtension #2435

Open
ExE-Boss opened this issue Apr 9, 2017 · 12 comments
Open

Create a WebExtension #2435

ExE-Boss opened this issue Apr 9, 2017 · 12 comments

Comments

@ExE-Boss
Copy link

ExE-Boss commented Apr 9, 2017

This is being worked on in: ExE‑Boss/mozilla‑shumway#web‑extension

Depends on bug 1457500

See also bug 1451083

With XUL, XPCOM and SDK addons being removed in Firefox 57, it would be nice to have a working WebExtension before then.

From my own experimentation, most of the code in content/web/ is re-useable, except for lines which refer to a URL of a Shumway resource.

Edit: after some testing, this has been resolved and the browser object is now accessible, but we should still use relative URLs instead.

Edit 2: this seems to be broken again (yay…), also see bug 1443253.

Those get changed to use the following snippet: (which has to be used, because the browser namespace is inaccessible from in-page iframes, unless we inject scripts into those through manifest.json)

/**
 * The non-browser specific extension address.
 * @type {string}
 * @author ExE Boss
 */
const extension_url = window.location.protocol + "//" + window.location.host + '/';

/**
 * Converts a relative path within an add-on's install directory to a fully-qualified URL.
 *
 * @param {string} path The path, relative to manifest.json.
 * @return {string} The same result as calling <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/extension/getURL">
 * <code>browser.extension.getURL(path)</code></a>.
 * @see <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/extension/getURL">
 * <code>browser.extension.getURL(path)</code></a>
 * @author ExE Boss
 */
function getURL(path) {
  if (path.charAt(0) === '/')
    path = path.slice(1);

  return extension_url + path;
}

I have done some work on this at ExE-Boss/mozilla-shumway#web-extension, previous attempt has been archived under ExE-Boss/mozilla-shumway#broken/web-extension/take1.

@nanonyme
Copy link

nanonyme commented Jun 11, 2017

@ExE-Boss Did you ever end up continuing on this? Something like this is definitely necessary if this project is not to be completely forgotten. Also imo if this done, should be investigated what's the amount of effort needed for cross-browser support for Shumway.

@ExE-Boss
Copy link
Author

ExE-Boss commented Jun 11, 2017

I won't be able to dedicate my time to this until at least July, and keep in mind that I also work on NOVA and my own projects (which includes a lot of unannounced stuff).

@ROBERT-MCDOWELL
Copy link

I shared the shumway link to some developers, maybe something good will go out soon.

@ExE-Boss
Copy link
Author

Also, after some testing, the browser object being nonexistent in moz-extension:// URLs, that aren't the background, options or popup pages, have been resolved in a recent release.

@ExE-Boss
Copy link
Author

I have shared this on /r/firefox, hopefully some developers will show up and help this project succeed.

@SoniEx2
Copy link

SoniEx2 commented Jun 19, 2017

I see an @ExE-Boss working on a Shumway...

Have you tried talking to Flash devs? e.g. https://twitter.com/MateuszSkutnik creator of http://www.mateuszskutnik.com/submachine/ ?

@ExE-Boss
Copy link
Author

@SoniEx2 Yes, I have played and won all the Submachine games. (But this discussion about what games I have played is off-topic)

@SoniEx2
Copy link

SoniEx2 commented Jun 19, 2017

I mean go get mateusz to work on shumway

@ExE-Boss
Copy link
Author

ExE-Boss commented Jun 19, 2017

Mateusz is a Flash game developer, not a JavaScript VM developer.

Shumway is a Flash VM implemented entirely in JavaScript using HTML5 technology.

@romulasry
Copy link

Tired on the latest Firefox 62.0.3, and ran into this issue. It would be interesting if there was an update.

@mirh
Copy link

mirh commented Dec 24, 2018

Depends on bug 1457500

Content handlers finally landed in 66 nightly

@TriMoon
Copy link

TriMoon commented Dec 25, 2018

Too bad we can't easily test the W.I.P. of this extension yet...
Would be nice to have a xpi in the releases section...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants