pmalecka / shortkeys

A Firefox extension for custom keyboard shortcuts
https://addons.mozilla.org/en-US/firefox/addon/shortkeys
MIT License
11 stars 4 forks source link

Site filter doesn't work in Firefox #10

Closed naoric closed 6 years ago

naoric commented 7 years ago

Thanks for this great addon. For some reason, the site filter doesn't work on Firefox - I tried to following pattern (enabled sites):

*translate.google.com*

And the shortcut didn't work anywhere. Whenever I apply a filter the shortcut is ignored everywhere. The only option is to enable all shortcuts everywhere...

pmalecka commented 6 years ago

Should be fixed in the linked commit. If you can - I would appreciate if you could build the extension and test in Firefox developer. I'll do the same and then upload a new version to AMO.

naoric commented 6 years ago

Will do, thank you!

naoric commented 6 years ago

I'm trying to setup an environment when I get the following errors:

gifsicle@0.1.7 postinstall /Users/naoric/projects/chrome-shortkeys/node_modules/gifsicle
> node index.js

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received { url: 'https://raw.github.com/imagemin/gifsicle-bin/v0.1.7/vendor/osx/gifsicle',
  name: 'gifsicle',
  os: 'darwin' }
    at assertPath (path.js:7:11)
    at Object.basename (path.js:1355:5)
    at /Users/naoric/projects/chrome-shortkeys/node_modules/download/index.js:35:43
    at each (/Users/naoric/projects/chrome-shortkeys/node_modules/each-async/each-async.js:63:4)
    at module.exports (/Users/naoric/projects/chrome-shortkeys/node_modules/download/index.js:33:5)
    at /Users/naoric/projects/chrome-shortkeys/node_modules/bin-wrapper/index.js:108:20
    at /Users/naoric/projects/chrome-shortkeys/node_modules/bin-wrapper/index.js:141:24
    at /Users/naoric/projects/chrome-shortkeys/node_modules/bin-check/index.js:30:20
    at /Users/naoric/projects/chrome-shortkeys/node_modules/executable/index.js:39:20
    at FSReqWrap.oncomplete (fs.js:123:15)

> optipng-bin@0.3.11 postinstall /Users/naoric/projects/chrome-shortkeys/node_modules/optipng-bin
> node index.js

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received { url: 'https://raw.github.com/imagemin/optipng-bin/v0.3.11/vendor/osx/optipng',
  name: 'optipng',
  os: 'darwin' }
    at assertPath (path.js:7:11)
    at Object.basename (path.js:1355:5)
    at /Users/naoric/projects/chrome-shortkeys/node_modules/download/index.js:35:43
    at each (/Users/naoric/projects/chrome-shortkeys/node_modules/each-async/each-async.js:63:4)
    at module.exports (/Users/naoric/projects/chrome-shortkeys/node_modules/download/index.js:33:5)
    at /Users/naoric/projects/chrome-shortkeys/node_modules/bin-wrapper/index.js:108:20
    at /Users/naoric/projects/chrome-shortkeys/node_modules/bin-wrapper/index.js:141:24
    at /Users/naoric/projects/chrome-shortkeys/node_modules/bin-check/index.js:30:20
    at /Users/naoric/projects/chrome-shortkeys/node_modules/executable/index.js:39:20
    at FSReqWrap.oncomplete (fs.js:123:15)

> pngquant-bin@0.3.5 postinstall /Users/naoric/projects/chrome-shortkeys/node_modules/pngquant-bin
> node index.js

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received { url: 'https://raw.github.com/imagemin/pngquant-bin/v0.3.5/vendor/osx/pngquant',
  name: 'pngquant',
  os: 'darwin' }
    at assertPath (path.js:7:11)
    at Object.basename (path.js:1355:5)
    at /Users/naoric/projects/chrome-shortkeys/node_modules/download/index.js:35:43
    at each (/Users/naoric/projects/chrome-shortkeys/node_modules/each-async/each-async.js:63:4)
    at module.exports (/Users/naoric/projects/chrome-shortkeys/node_modules/download/index.js:33:5)
    at /Users/naoric/projects/chrome-shortkeys/node_modules/bin-wrapper/index.js:108:20
    at /Users/naoric/projects/chrome-shortkeys/node_modules/bin-wrapper/index.js:141:24
    at /Users/naoric/projects/chrome-shortkeys/node_modules/bin-check/index.js:30:20
    at /Users/naoric/projects/chrome-shortkeys/node_modules/executable/index.js:39:20
    at FSReqWrap.oncomplete (fs.js:123:15)
npm WARN shortkeys-custom-keyboard-shortcuts@0.0.0 No repository field.
npm WARN shortkeys-custom-keyboard-shortcuts@0.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: gifsicle@0.1.7 (node_modules/gifsicle):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: gifsicle@0.1.7 postinstall: `node index.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: optipng-bin@0.3.11 (node_modules/optipng-bin):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: optipng-bin@0.3.11 postinstall: `node index.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: pngquant-bin@0.3.5 (node_modules/pngquant-bin):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: pngquant-bin@0.3.5 postinstall: `node index.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

added 7 packages in 5.171s

What version of npm/node should I use? should I install some packages globally?

pmalecka commented 6 years ago

I've seen that issue before, AMO reviewer had something similar. Are you on mac?

Edit: I updated the package.json with a new version of grunt-contrib-imagemin, try running npm install - to see if that helps.

Try running the following command: npm install gruntjs/grunt-contrib-imagemin

Node version is specified on the package.json: "node": ">=0.8.0" so you'd get a warning when running npm install.

If the above does not work, then try this: npm cache clean npm install gruntjs/grunt-contrib-imagemin

if that does not work try: npm install grunt-contrib-imagemin --save-dev npm install imagemin-gifsicle --save-dev npm install imagemin-jpegtran --save-dev npm install imagemin-optipng --save-dev npm install imagemin-pngquant --save-dev

or: npm install grunt-contrib-imagemin --save-dev

naoric commented 6 years ago

@pmalecka Thanks so much! Looks like it works, even though I get this whenever I use the extension:

Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src https://assets-cdn.github.com”). Source: const loc = window.location.href.match(/....

I guess it's because it is not signed (already allowed unsigned extension in about:config and still)

Did you upload it to AMO yet?

pmalecka commented 6 years ago

That's super weird, there's no reference to https://assets-cdn.github.com nowhere in the code. Are you testing on an empty profile in firefox developer? Where are you seeing the error popup window, console, browser console)?

I just installed on my deily profile to test this a bit, too. Will upload to AMO shortly - but be warned that approval process takes some time (~20days).

naoric commented 6 years ago

I see it in the console when the key doesn't work, will try again with an empty profile (used my profile to test it)