saka icon indicating copy to clipboard operation
saka copied to clipboard

Saka isn't reliably focused on Firefox

Open eejdoowad opened this issue 7 years ago • 6 comments

eejdoowad avatar Nov 17 '17 09:11 eejdoowad

True... One example is when you first Ctrl+L to higlight the tab bar, then you hit the saka combination, that won't move the focous to saka input field.

3v1n0 avatar Dec 15 '17 21:12 3v1n0

Sure. so many feature missing.

azzamsa avatar Mar 27 '18 09:03 azzamsa

So I have looked into this and it does not seem easy to fix. In particular, when we are dealing with trying to take focus away from the omnibar, it seems like the browser itself will prevent an extension from doing this. There is a workaround involving a hacky solution where the extension deletes the existing tab and clones it into a new instance of the tab. I would prefer to solve this using a more elegant solution than that but it does not seem to be easy to accomplish.

I'm going to instead try and focus on scenarios where the user is simply focused on an input inside a webpage (ex. the search on github) and then opens Saka.

pureooze avatar Apr 10 '18 22:04 pureooze

How about using windows.create api instread of injecting

Like this:

  var w = WIDTH;
  var h = HEIGHT;
  var left = (screen.width / 2) - (w / 2);
  var top = (screen.height / 2) - (h / 2);

  browser.windows.create({
    'url': '/saka.html',
    'type': 'popup',
    'width': w,
    'height': h,
    'left': left,
    'top': top
  });
2019-01-26 6 10 16

What's good:

  • Reliable focus
  • Simpler toggleSaka() logic (just store saka on off state globally and use it to determine open/close action, maybe it's better to introduce redux.)
  • Better looking than as is in some cases: open a new tab and then show saka overlay

What's bad:

  • Additional titlebar appears in popup window which is not needed.
  • Additional popup animation.

If this popup solution is acceptable, I'll work on it and create PR.

kimjson avatar Jan 26 '19 06:01 kimjson

Hi @steinkim, thanks for looking into this. I'm not sure how I feel about using a popup like this. On the one hand it does address some issues we have but at the same time I really don't like seeing the title bar.

pureooze avatar Jan 28 '19 23:01 pureooze

@pureooze https://chrome.google.com/webstore/detail/searchbar/fjefgkhmchopegjeicnblodnidbammed I'm trying manipulating chrome extension default popup location like this chrome extension(after work).

kimjson avatar Jan 29 '19 07:01 kimjson