2

Listener onBlur works when i click on header of any tab, but event doesn't fire when I click on icon of another sidebar extension or when I close sidebar

opr.sidebarAction.onBlur.addListener(function(w) {
  console.log('on blur event');
});

Seems like doubtful feature in Opera extensions API...

StayAtHome
  • 81
  • 1
  • 8
  • On which platform are you testing? Linux, Windows or Mac? – Krzysztof Szularz Jul 22 '15 at 09:32
  • Windows 7 32bit, Opera Developer 32.0.1933 – StayAtHome Jul 23 '15 at 07:57
  • When we listen for the event in the background page of our test extension, onBlur is sent correctly for situations you specified. The only problem is while switching between tabs, where actually event should not be sent since focus is still on the sidebar (and that's a bug). Main question is if you are listening for the event from background page of the extension or just from panel? In the 2nd case you will not get onBlure because you just close the panel page while switching to another extension (or closing sidebar). – Łukasz Bendig Jul 23 '15 at 11:18
  • Yes, I waited for onBlur event in sidebar panel (because this event is clearly documented in the "opr.sidebarAction" section, not as a general Chromium API feature). Ok, I'll try to move the listener to the background page. – StayAtHome Jul 27 '15 at 12:08
  • Yes, after moving listener to he background page all works, thanks! – StayAtHome Oct 13 '15 at 09:03

1 Answers1

0

Listener onBlur must be on background page of the extension.

StayAtHome
  • 81
  • 1
  • 8