carlin-q-scott / browser-media-keys

Lets you control many web players using the media keys on your keyboard.
Mozilla Public License 2.0
123 stars 31 forks source link

Hotkey registration failed in 1.0.0 #96

Open gcapd opened 7 years ago

gcapd commented 7 years ago

I just noticed an error message when opening Firefox after the update of the media-keys extension, in Ubuntu 14.04.

It says that the "Hotkey registration failed", and that they are in use, probably by the "Global keyboard shortcuts" of the system. In fact they are, I thought that setting the shortcuts in the "global keyboard shortcuts" was the (only) method to set the shortcut for the extension. My keyboard lacks some media buttons and I have my custom shortcuts.

I guess there's been some change in the hotkey registration of the extension, but is there any way now to set my own shortcuts when some keys are missing? Or is this some bug?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38184969-hotkey-registration-failed-in-1-0-0?utm_campaign=plugin&utm_content=tracker%2F7600490&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F7600490&utm_medium=issues&utm_source=github).
carlin-q-scott commented 7 years ago

@Noitidart can you provide some insight on this?

Noitidart commented 7 years ago

We haven't yet implemented changing the hotkey. What you can do though is unset those hotkeys in the global keyboard shortcuts, then restart the addon (disable then enable) or restart the browser and it should work.

I think the setting of shortcuts in the global keyboard section was a workaround some of the users devised. There is no more need for this workaround.

gcapd commented 7 years ago

Thanks @Noitidart, setting the shortcuts directly from the extension will be more intuitive and a great addition!

However, in the meantime, if I unset the shortcuts in the global keyboard section, I will not be able to set any custom shortcuts right? For instance, I don't have a "next" and "previous" keys in my keyboard and I am using a custom combination.

Noitidart commented 7 years ago

@gcapd that's correct. You can modify the addon very simply and upload an unlisted addon for yourself. You simply need to edit the code entry in the object here: https://github.com/carlin-q-scott/browser-media-keys/blob/mac-support/lib/MainWorker.js#L164-L287

The possible values are listed here:

https://github.com/Noitidart/ostypes/blob/master/ostypes_x11.jsm#L1057-L1505

@carlin-q-scott may you please update the ostypes module so it has all these keys.

Noitidart commented 7 years ago

@gcapd if you need help identifying what key aligns to what code you can go to this addon:

https://addons.mozilla.org/en-US/firefox/addon/topick/

Then go to the options page and then change your key. It listens as you change the key. So it tells you what code you hit.

carlin-q-scott commented 7 years ago

@Noitidart v1.0.0 was released with head of your os-types repo master branch. At least that's what git is telling me.

carlin-q-scott commented 7 years ago

Nevermind, apparently "update all submodules" means reset. Should I push this out now or is it too bleeding edge with latest everything from your submodules?

Noitidart commented 7 years ago

Hey @carlin-q-scott excuse the delay. The latest will work fine :) I only added more definitions. No corrections were needed. But with the more defintions, users will be able to set any key they want.

Well it might be a good idea to test it out before releasing haha.

carlin-q-scott commented 7 years ago

Could one of you test out the update before I publish it? My Linux machine has hardware issues at the moment. browsermediakeys.zip

Noitidart commented 7 years ago

I can't test on Linux I don't have any of the media keys on my Linux or Mac (both are VMs), hopefully @gmelikov can help with Linux if he's free. And @X-Ryl669 can help with Mac if he's free.

X-Ryl669 commented 7 years ago

What do you want me to test ? I'm not 100% sure I understand what the initial issue is...

Noitidart commented 7 years ago

@X-Ryl669 thanks for popping in! @carlin-q-scott created a mac production version in https://github.com/carlin-q-scott/browser-media-keys/issues/96#issuecomment-252660699 - may you please download the zip, rename to xpi, and install via about:debugging to see if it works as expected.

X-Ryl669 commented 7 years ago

You just want me to run the extension, or to try to register some (different) hotkeys ?

Noitidart commented 7 years ago

Just run it please. The registering different hotkeys mechanism was not yet implemented.

X-Ryl669 commented 7 years ago

Nope, it does not work. The one accessible from the Mozilla extension's store works however. Here's the dump of the browser console:

          casted subtype: 7shtkPollWorker.js:114:7
Error: When not using *.example.org wildcard, the string supplied is expected to be either an exact URL to match or a URL prefix. The provided string ('') is unlikely to match any pages.match-pattern.js:46:15
casted subtype: 7shtkPollWorker.js:114:7
browsermediakeys:called and did destroyhotkeyManager.js:165
1476120408995   addons.xpi  WARN    Addon with ID jid1-4GP7z3tkUd3Tzg@jetpack already installed, older version will be disabled
Comm.client.worker - incoming, payload: Object { method: "onBeforeTerminate", arg: null, cbid: 2 }Comm.js:490:5
doing mainworker term procMainWorker.js:44:2
gShtkPollStuff: Object { runloop_ref_strofptr: "0x19ce12f40" }shtkMainworkerSubscript.js:372:6
ok onBeforeTerminate return pointMainWorker.js:72:2
rez_run: 2shtkPollWorker.js:300:6
Comm.client.worker - incoming, payload: Object { method: "hotkeysUnregisterPl", arg: null, cbid: 2 }Comm.js:490:5
invalidated _eventPortSourceshtkPollWorker.js:253:5
released _eventPortSourceshtkPollWorker.js:255:5
released _eventPortshtkPollWorker.js:259:5
released tapEventCallbackshtkPollWorker.js:262:5
Comm.server.worker - incoming, payload: Object { method: null, arg: undefined, cbid: 2 }Comm.js:87:5
Could not read chrome manifest 'file:///Applications/Firefox.app/Contents/Resources/chrome.manifest'.
Not enough arguments for chrome manifest directive 'locale', expected 3.chrome.manifest:5
Comm.client.worker - incoming, payload: Object { method: null, arg: undefined, cbid: 2 }Comm.js:490:5
Comm.client.worker - Fullfilled - rez_scope -  Array [ Array[2] ]Comm.js:507:10
Error: When not using *.example.org wildcard, the string supplied is expected to be either an exact URL to match or a URL prefix. The provided string ('') is unlikely to match any pages.
Trace de la pile :
MatchPattern@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/match-pattern.js:46:15
filterMatches@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/rules.js:50:9
Rules<.matchesAny@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/rules.js:41:14
modMatchesURI@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:37:35
applyOnExistingDocuments@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:135:37
PageMod@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:83:7
@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/disposable.js:45:56
dispatch@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/method/core.js:119:12
Disposable<.initialize@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/disposable.js:135:17
constructor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/heritage.js:146:23
@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:229:3
emitOnObject@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:112:9
emit@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:89:38
messageReceived@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/remote/child.js:67:37
core.js:106
Error: When not using *.example.org wildcard, the string supplied is expected to be either an exact URL to match or a URL prefix. The provided string ('') is unlikely to match any pages.
Trace de la pile :
MatchPattern@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/match-pattern.js:46:15
filterMatches@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/rules.js:50:9
Rules<.matchesAny@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/rules.js:41:14
modMatchesURI@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:37:35
applyOnExistingDocuments@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:135:37
PageMod@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:83:7
@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/disposable.js:45:56
dispatch@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/method/core.js:119:12
Disposable<.initialize@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/disposable.js:135:17
constructor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/heritage.js:146:23
@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:229:3
emitOnObject@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:112:9
emit@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:89:38
messageReceived@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/remote/child.js:67:37
core.js:106
Error: When not using *.example.org wildcard, the string supplied is expected to be either an exact URL to match or a URL prefix. The provided string ('') is unlikely to match any pages.
Trace de la pile :
MatchPattern@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/match-pattern.js:46:15
filterMatches@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/rules.js:50:9
Rules<.matchesAny@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/rules.js:41:14
modMatchesURI@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:37:35
applyOnExistingDocuments@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:135:37
PageMod@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:83:7
@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/disposable.js:45:56
dispatch@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/method/core.js:119:12
Disposable<.initialize@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/disposable.js:135:17
constructor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/heritage.js:146:23
@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:229:3
emitOnObject@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:112:9
emit@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:89:38
messageReceived@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/remote/child.js:67:37
core.js:106
Error: When not using *.example.org wildcard, the string supplied is expected to be either an exact URL to match or a URL prefix. The provided string ('') is unlikely to match any pages.
Trace de la pile :
MatchPattern@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/match-pattern.js:46:15
filterMatches@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/rules.js:50:9
Rules<.matchesAny@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/rules.js:41:14
modMatchesURI@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:37:35
applyOnExistingDocuments@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:135:37
PageMod@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:83:7
@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/disposable.js:45:56
dispatch@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/method/core.js:119:12
Disposable<.initialize@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/disposable.js:135:17
constructor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/heritage.js:146:23
@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/page-mod.js:229:3
emitOnObject@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:112:9
emit@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:89:38
messageReceived@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/remote/child.js:67:37
core.js:106
Comm.client.worker - incoming, payload: Object { method: "reinitHotkeys", arg: Object, cbid: null }Comm.js:490:5
in worker init, aArg: undefinedMainWorker.js:17:2
done init hotkeysMainWorker.js:290:2
Comm.client.worker - incoming, payload: Object { method: "hotkeysRegister", arg: null, cbid: 1 }Comm.js:490:5
Comm.client.worker - incoming, payload: Object { method: null, arg: Object, cbid: 1 }Comm.js:490:5
Comm.client.worker - incoming, payload: Object { method: "init", arg: Object, cbid: null }Comm.js:490:5
Comm.server.worker - incoming, payload: Object { method: "triggerOnAfterInit", arg: Object, cbid: null }Comm.js:87:5
Comm.client.worker - incoming, payload: Object { method: "hotkeysRegisterPl", arg: Object, cbid: 1 }Comm.js:490:5
gMacStuff._eventPort: __CFMachPort.ptr(ctypes.UInt64("0x19c49b440"))shtkPollWorker.js:193:5
gMacStuff._eventPortSource: __CFRunLoopSource.ptr(ctypes.UInt64("0x19c712380"))shtkPollWorker.js:203:5
did CFRunLoopAddSourceshtkPollWorker.js:216:5
Comm.server.worker - incoming, payload: Object { method: null, arg: Object, cbid: 1 }Comm.js:87:5
Comm.client.worker - Fullfilled - rez_scope -  undefinedComm.js:507:10
TypeError: aLevel is not a function[En savoir plus]Console.jsm:508:9
casted subtype: 7
X-Ryl669 commented 7 years ago

Wait. I've removed the official addon, then installed the one attached in this thread, and it failed. However, I've restarted the browser (so without any mediakey addon remaining since the addon in this thread is in "debugging") and installed the addon from this thread again and it worked.

X-Ryl669 commented 7 years ago

Well, no it does not work anymore finally after some time, the iTunes s...t triggers (so it means that the Play/Pause hotkey is no more registered...)

gmelikov commented 7 years ago

I tested both 1.0 and this zip one, tested via xdotool key XF86AudioPlay, it worked.

Debian Jessie/testing, Xfce, Firefox 49b01

gmelikov commented 7 years ago

About this issue - i think hardcoded hotkeys may give problems on some machines with any OS.

gmelikov commented 7 years ago

I made a #97 commit, added info about XCB support and method to simulate media keys in Linux.

Noitidart commented 7 years ago

@X-Ryl669 - I'm thinking maybe your addon got auto updated away from the debugging version. @carlin-q-scott did you change anything since the PR that might affect this? Maybe we can get X-Ryl a version of the debugging with console logging and see what the console says.

Noitidart commented 7 years ago

Hm it seems nothing changed in the files of interest - https://github.com/carlin-q-scott/browser-media-keys/compare/baa926bd60778c300293ffa84e093a15de5461c4...15954a9c0848634ceeca22edbdbc85d0a790892a

@X-Ryl669 can you please share another console log output. Please make sure your addon is not auto updated to another version. You can turn of auto update from addon manager.

X-Ryl669 commented 7 years ago

Got this:

Comm.client.worker - incoming, payload: Object { method: "hotkeysRegister", arg: null, cbid: 2 }Comm.js:473:5
Comm.client.worker - incoming, payload: Object { method: "hotkeysRegisterPl", arg: Object, cbid: 3 }Comm.js:473:5
gMacStuff._eventPort: __CFMachPort.ptr(ctypes.UInt64("0x1a0382480"))shtkPollWorker.js:192:5
gMacStuff._eventPortSource: __CFRunLoopSource.ptr(ctypes.UInt64("0x1a2cae540"))shtkPollWorker.js:202:5
did CFRunLoopAddSourceshtkPollWorker.js:215:5
Comm.server.worker - incoming, payload: Object { method: null, arg: Object, cbid: 3 }Comm.js:87:5
Comm.client.worker - incoming, payload: Object { method: null, arg: Object, cbid: 3 }Comm.js:473:5
Comm.client.worker - Fullfilled - rez_scope -  undefinedComm.js:490:10
Error: When not using *.example.org wildcard, the string supplied is expected to be either an exact URL to match or a URL prefix. The provided string ('') is unlikely to match any pages.match-pattern.js:46:15
Comm.client.worker - incoming, payload: Object { method: "hotkeysUnregister", arg: undefined, cbid: null }Comm.js:473:5
gShtkPollStuff: Object { runloop_ref_strofptr: "0x1a8532ac0" }shtkMainworkerSubscript.js:372:6
rez_run: 2shtkPollWorker.js:299:6
Comm.client.worker - incoming, payload: Object { method: "hotkeysUnregisterPl", arg: null, cbid: 4 }Comm.js:473:5
invalidated _eventPortSourceshtkPollWorker.js:252:5
released _eventPortSourceshtkPollWorker.js:254:5
released _eventPortshtkPollWorker.js:258:5
released tapEventCallbackshtkPollWorker.js:261:5
Comm.server.worker - incoming, payload: Object { method: null, arg: undefined, cbid: 4 }Comm.js:87:5
Comm.client.worker - incoming, payload: Object { method: null, arg: undefined, cbid: 4 }

Yet, the addon is still listed in the about:addons page. Pressing media keys does not work. I've then disabled the addon and enabled it again (media keys still did not work) Then I've "unpinned" the key from the pinned tab, and pinned it again and it started working again (it's possible the addon enabling took many, many seconds, at least more than 10s)

The log output for the actions above is this:

TypeError: vAPI.executionCost is undefined[En savoir plus]contentscript.js:419:9
tab is null
ext-utils.js:494
TypeError: uri is undefined[En savoir plus]MatchPattern.jsm:73:9
aucun élément trouvécheck:1:1
TypeError: aTab is null[En savoir plus]SessionStore.jsm:2306:1
Une chaîne vide a été transmise à « getElementById() ».rs=AHGWq9DWiwU6jAZ_JcquZGMORYmSUVeZng:395:341
Error: When not using *.example.org wildcard, the string supplied is expected to be either an exact URL to match or a URL prefix. The provided string ('') is unlikely to match any pages.match-pattern.js:46:15
TypeError: NetworkError when attempting to fetch resource.(source inconnue)
browsermediakeys:called and did destroyhotkeyManager.js:165
Comm.client.worker - incoming, payload: Object { method: "onBeforeTerminate", arg: null, cbid: 3 }Comm.js:473:5
doing mainworker term procMainWorker.js:44:2
ok onBeforeTerminate return pointMainWorker.js:72:2
Comm.client.worker - Fullfilled - rez_scope -  Array [ Array[0] ]Comm.js:490:10
Could not read chrome manifest 'file:///Applications/Firefox.app/Contents/Resources/chrome.manifest'.
Not enough arguments for chrome manifest directive 'locale', expected 3.chrome.manifest:5
Comm.client.worker - incoming, payload: Object { method: "reinitHotkeys", arg: Object, cbid: null }Comm.js:473:5
in worker init, aArg: undefinedMainWorker.js:17:2
done init hotkeysMainWorker.js:290:2
Comm.client.worker - incoming, payload: Object { method: "hotkeysRegister", arg: null, cbid: 1 }Comm.js:473:5
Comm.client.worker - incoming, payload: Object { method: null, arg: Object, cbid: 1 }Comm.js:473:5
Comm.client.worker - incoming, payload: Object { method: "init", arg: Object, cbid: null }Comm.js:473:5
Comm.server.worker - incoming, payload: Object { method: "triggerOnAfterInit", arg: Object, cbid: null }Comm.js:87:5
Comm.client.worker - incoming, payload: Object { method: "hotkeysRegisterPl", arg: Object, cbid: 1 }Comm.js:473:5
gMacStuff._eventPort: __CFMachPort.ptr(ctypes.UInt64("0x2427dc880"))shtkPollWorker.js:192:5
gMacStuff._eventPortSource: __CFRunLoopSource.ptr(ctypes.UInt64("0x2427db800"))shtkPollWorker.js:202:5
did CFRunLoopAddSourceshtkPollWorker.js:215:5
Comm.server.worker - incoming, payload: Object { method: null, arg: Object, cbid: 1 }Comm.js:87:5
Comm.client.worker - Fullfilled - rez_scope -  undefinedComm.js:490:10
casted subtype: 7shtkPollWorker.js:114:7
casted subtype: 7shtkPollWorker.js:114:7
casted subtype: 7shtkPollWorker.js:114:7
TypeError: this.previous is null
[En savoir plus]pageWorkerManager.js:75:1
casted subtype: 7shtkPollWorker.js:114:7
casted subtype: 8shtkPollWorker.js:114:7
casted data1: 1051136shtkPollWorker.js:122:8
current mods: Object { meta: false, shift: false, alt: false, control: false } hotkey->mods: Object {  } keyModifiers: 256shtkPollWorker.js:156:10
Comm.server.worker - incoming, payload: Object { method: "hotkeyMacCallback", arg: Object, cbid: null }Comm.js:87:5
browsermediakeys:in mainthread EmitEventToActivePageWorker, aKeyName: MediaPlayPausehotkeyManager.js:26
casted subtype: 8shtkPollWorker.js:114:7
casted data1: 1051392shtkPollWorker.js:122:8
current mods: Object { meta: false, shift: false, alt: false, control: false } hotkey->mods: Object {  } keyModifiers: 256shtkPollWorker.js:156:10
Comm.server.worker - incoming, payload: Object { method: "hotkeyMacCallback", arg: Object, cbid: null }Comm.js:87:5
time past is not yet greater than min_time_between_repeat, time past: 87 ms, last_triggered: 1476353780631shtkMainworkerSubscript.js:546:12
casted subtype: 8shtkPollWorker.js:114:7
casted data1: 1051136shtkPollWorker.js:122:8
current mods: Object { meta: false, shift: false, alt: false, control: false } hotkey->mods: Object {  } keyModifiers: 256shtkPollWorker.js:156:10
Comm.server.worker - incoming, payload: Object { method: "hotkeyMacCallback", arg: Object, cbid: null }Comm.js:87:5
browsermediakeys:in mainthread EmitEventToActivePageWorker, aKeyName: MediaPlayPausehotkeyManager.js:26
casted subtype: 8shtkPollWorker.js:114:7
casted data1: 1051392shtkPollWorker.js:122:8
current mods: Object { meta: false, shift: false, alt: false, control: false } hotkey->mods: Object {  } keyModifiers: 256shtkPollWorker.js:156:10
Comm.server.worker - incoming, payload: Object { method: "hotkeyMacCallback", arg: Object, cbid: null }Comm.js:87:5
time past is not yet greater than min_time_between_repeat, time past: 119 ms, last_triggered: 1476353783135shtkMainworkerSubscript.js:546:12
TypeError: uri is undefined[En savoir plus]MatchPattern.jsm:73:9
casted subtype: 7shtkPollWorker.js:114:7
When cancelling a request for chrome://mozapps/skin/extensions/extensionGeneric-16.png because the inner window was destroyed or a new favicon was loaded for it, it was already canceled!
PlacesUIUtils.jsm:109
casted subtype: 7shtkPollWorker.js:114:7
Noitidart commented 7 years ago

But it seems due to this error:

Error: When not using *.example.org wildcard, the string supplied is expected to be either an exact URL to match or a URL prefix. The provided string ('') is unlikely to match any pages.match-pattern.js:46:15

It is calling out to unregisterHotkeys. From the output it doesn't seem the issue is in the hotkey code, @carlin-q-scott your help in investigating is needed please. I don't know how the page script mechanics works.

X-Ryl669 commented 7 years ago

Right, I've only filled the Koel part in the setting page since I'm only interested in this. The other entries are all blank. Yet, it's set this way since the beginning, used to work.

carlin-q-scott commented 7 years ago

@Noitidart the pageWorkerManager.js was not modified since the previous version that worked for @X-Ryl669 so I don't think that error message is relevant although maybe it's possible that his prefs for the add-on were corrupted.

@X-Ryl669 could you delete or reset this add-on's preferences to see it that fixes the issue you're experiencing? Based on this I think the only way to reset them is via about:config. Search for extensions.browsermediakeys or extensions.jid1-4GP7z3tkUd3Tzg@jetpack and delete or reset all of them. I don't think these preferences are removed or reset when reinstalling the add-on.

Noitidart commented 7 years ago

I had changed it so the ChromeWorker stays alive from startup till end. So hotkeys register and unregister happen witout startingup and destoring the ChromeWorker. it was different from what you had, but it worked better in my tests. I had posted somewhere that it might not work with the rest of your addon, as I didn't look into your whole addon, just the hotkey part. Do you think this has any affect?

carlin-q-scott commented 7 years ago

@Noitidart That could be causing problems since simply refreshing a page will de-register and re-register hotkeys if it's the only media page open. I mitigated that risk by adding a two second pause before de-registering but I think you modified that code so maybe it's not working as intended.

Noitidart commented 7 years ago

@carlin-q-scott did you get a chance to do a review of my code yet? I really wish I could do more, but I don't have the time to review all the code around the hotkey module to see if its working nicely with everything else.

gcapd commented 7 years ago

Hello! I wanted to ask if there is any news on this, as finally my account got updated to the new layout and I will not be able to use the old version of the mediakeys anymore (I was using 0.7.8 for now and it was working perfectly). I guess that #109 is the same as mine. I don't have a keyboard with media keys (it's a laptop) and it would be awesome to be able to customize which are the key combinations (as it could be done before) as for now I can't use the addon anymore :(

Thank you!

gcapd commented 7 years ago

Just add that I missed the xdotool workaround suggested above in the thread and it works like a charm! (I tested it with youtube). With it I can customize the media keys again!

I neither saw the added comment in the mac-support branch regarding linux and version > 1.0 in which the xdotool command is commented (maybe this text could be also added to the master branch under the linux support section so it's easier to find?)

gmelikov commented 7 years ago

@gcapd thanks, looks like I pushed changes to wrong branch, oops...