ericwoodruff / passwordhasherplus

Password Hasher Plus
http://goo.gl/LyLk3
Other
12 stars 21 forks source link

Make Password Hasher Plus compatible with Firefox #33

Closed simu closed 6 years ago

simu commented 7 years ago

The changes in this request make the extension work on both Firefox and Chrome.

I've had to move around some HTML tags because Firefox wants a <meta charset="utf-8"> tag somewhere in the first 1024 bytes of each HTML file.

I've also replaced some Chrome API usages which are deprecated in Chrome and not implemented in Firefox with their updated counterparts.

There are a few issues:

  1. The CSS declarations that resize the popup for Chrome cause Firefox to display a zero-height popup, so I've omitted them for now
  2. I had to update jquery and jquery.qtip because Mozilla's automatic addon validator complained about jquery 1.7.1
  3. Generating the portable page doesn't work in Firefox because Firefox does not allow execution of inline Javascript in web-accessible addon resources by default, and adding a CSP for inline javascript needs a hash of the file which contains the javascript which is impossible to precompute for the portable page.
ericwoodruff commented 7 years ago
Thanks, I will have to test this out when I get a chance.

On 01/24/2017 07:36 AM, Simon Gerber
  wrote:

  The changes in this request make the extension work on both
    Firefox and Chrome.
  I've had to move around some HTML tags because Firefox wants a
    <meta charset="utf-8"> tag somewhere in the
    first 1024 bytes of each HTML file.
  I've also replaced some Chrome API usages which are deprecated
    in Chrome and not implemented in Firefox with their updated
    counterparts.
  There are a few issues:

    The CSS declarations that resize the popup for Chrome cause
      Firefox to display a zero-height popup, so I've omitted them
      for now
    I had to update jquery and jquery.qtip because Mozilla's
      automatic addon validator complained about jquery 1.7.1
    Generating the portable page doesn't work in Firefox because
      Firefox does not allow execution of inline Javascript in
      web-accessible addon resources by default, and adding a CSP
      for inline javascript needs a hash of the file which contains
      the javascript which is impossible to precompute for the
      portable page.

  You can view, comment on, or merge this pull request online
    at:
    https://github.com/ericwoodruff/passwordhasherplus/pull/33
  Commit Summary

    Make extension compatible with Firefox
    Cleanup some Firefox warnings
    Update jquery to 3.1.1 for AMO
    Update jquery.qtip to work with jquery 3.1.1
    Update to not use chrome.tabs.getSelected(), and only
      require activeTab permission
    Add make rule for Firefox web extension zip
    Fix call to chrome.tabs.query()
    Simplify popup code to always use chrome.tabs.query()
    Replace chrome.extension with chrome.runtime which works in
      both Chrome and Firefox.

  File Changes

     M Makefile
      (3) 
     M background.html
      (3) 
     M background.js
      (3) 
     M content-script.js
      (4) 
     D lib/jquery-1.7.1.min.js
      (4) 
     A lib/jquery-3.1.1.min.js
      (4) 
     M lib/jquery.qtip.min.css
      (2) 
     M lib/jquery.qtip.min.js
      (18) 
     M manifest.json
      (31) 
     M options.html
      (7) 
     M options.js
      (4) 
     M passhashplus.html
      (7) 
     M popup.html
      (12) 
     M popup.js
      (11) 

  Patch Links:

    https://github.com/ericwoodruff/passwordhasherplus/pull/33.patch
    https://github.com/ericwoodruff/passwordhasherplus/pull/33.diff

  —
    You are receiving this because you are subscribed to this
    thread.
    Reply to this email directly, view
      it on GitHub, or mute
      the thread.

  {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/ericwoodruff/passwordhasherplus","title":"ericwoodruff/passwordhasherplus","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/ericwoodruff/passwordhasherplus"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Make Password Hasher Plus compatible with Firefox (#33)"}],"action":{"name":"View Pull Request","url":"https://github.com/ericwoodruff/passwordhasherplus/pull/33"}}}
simu commented 6 years ago

I'm closing this pull request because I haven't kept track of Chrome compatibility, and know for a fact that the WebExtensions storage API is different in Firefox and Chrome. Firefox uses Promises where Chrome uses callback functions to handle the storage API asynchronicity.