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

Transition to Jetpack SDK #62

Open
2 of 5 tasks
Thiht opened this issue Feb 22, 2016 · 11 comments
Open
2 of 5 tasks

Transition to Jetpack SDK #62

Thiht opened this issue Feb 22, 2016 · 11 comments

Comments

@Thiht
Copy link
Owner

Thiht commented Feb 22, 2016

Following #20 and #46, + the fact Mozilla is progressively deprecating XUL extensions, it becomes urgent to transition to another solution.

The two solutions are the Jetpack SDK and WebExtensions.

WebExtensions don't allow mime-type registering (yet?) so they're not an option for now.

As always, bhollis/jsonview is a good source of inspiration since it does the same thing as Markdown Viewer but for JSON :)

Important things to check along the development:

  • Linux support
  • Windows support
  • UTF-8 support
  • Electrolysis support
  • Basically no behavioral regression
@Thiht
Copy link
Owner Author

Thiht commented Feb 23, 2016

WIP on branch no-restart

@Croydon
Copy link

Croydon commented Feb 3, 2017

Any new information on that? Since SDK will also be deprecated at the end of this year WebExtensions are the only way to go forward.

@Thiht
Copy link
Owner Author

Thiht commented Feb 3, 2017

As far as I'm aware, and according to all the tests I've done, there's no way to make Markdown Viewer work with either Jetpack or WebExtensions.

Markdown Viewer needs to register the ".md" extension to Firefox (see this code) but it doesn't seem to be possible with either of the APIs, and I doubt it'll ever be possible in the future, given the direction taken by Mozilla to standardize extensions between browsers. The idea is good but not applicable since Gecko and Chromium platforms are fundamentally different.

Enjoy Markdown Viewer if it still works for you, or else consider it dead :(

@Croydon
Copy link

Croydon commented Feb 3, 2017

What if you just check the URL if it ends on .md ?

@Thiht
Copy link
Owner Author

Thiht commented Feb 3, 2017

It's not enough, it breaks on Linux because Firefox will download the file instead of displaying it.

@ghost
Copy link

ghost commented Feb 6, 2017

With some persistence... I am happy to report that I was able to solve this issue. I was able to trick Firefox by modifying a local MIME type in Linux:

https://wiki.archlinux.org/index.php/default_applications#New_MIME_types

Here is what mine looks like currently with it working:

<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="text/plain">
    <glob pattern="*.md"/>
    <glob pattern="*.mkd"/>
    <glob pattern="*.markdown"/>
  </mime-type>
</mime-info>

@Croydon
Copy link

Croydon commented Feb 6, 2017

@braderhart This might be a local workaround not a real solution how this can be rewritten as a webextension.

@ghost
Copy link

ghost commented Feb 6, 2017

@Croydon I agree we need a better solution from Mozilla with WebExtensions for sure, but to finally get a fix—even if isn't the "proper" approach—it still solves a long-standing bug quite well for the time-being, and doesn't really seem to cause any issues.

You may even be able to create a proper fix yourself using the info provided here:

https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html

@mixedpuppy
Copy link

If the only issue is reading the download stream as indicated by the code linked to in a previous comment, you should be able to do that since webRequest.onResponseData landed.

https://bugzilla.mozilla.org/show_bug.cgi?id=1255894

@mixedpuppy
Copy link

Sorry, it hasn't landed yet, but is close.

@Croydon
Copy link

Croydon commented Sep 18, 2017

Landed.

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

No branches or pull requests

3 participants