utubo / firefox-simple_gesture

🦊An add-on that adds simple touch gestures for Firfox for Android. Sorry, I only check issues sometimes.
https://addons.mozilla.org/ja/firefox/addon/simple-gesture/
Other
32 stars 1 forks source link

Extend add-in to allow "Open link in background" into discarded state #86

Closed Glaser-Martin closed 2 months ago

Glaser-Martin commented 2 months ago

Can you please provide an additional Gesture or extend the existing "Open link in background" Gesture with an option to have the tab created and made visible in the tab bar without any content loaded into memory.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/create#muted

...says browser.tabs.create has already option discarded for that.

I tried with a Custom Gesture, but I fail, because browser.tabs is not available and I can not put additional options into open or doCommand for the browser.tabs.create. BTW. the for loop in your second example in https://github.com/utubo/firefox-simple_gesture/wiki/Custom-gesture-examples did not work out for me, target is not going to parent nodes, I used then while like in other examples and that works.

utubo commented 2 months ago

This is a good idea. I'll get right on it.

I tried with a Custom Gesture, but I fail, because browser.tabs is not available and I can not put additional options into open or doCommand for the browser.tabs.create.

I am trying to figure out how to implement that.

BTW. the for loop in your second example in https://github.com/utubo/firefox-simple_gesture/wiki/Custom-gesture-examples did not work out for me, target is not going to parent nodes, I used then while like in other examples and that works.

Thx ! I fixed it.

utubo commented 2 months ago

discarded does not work Firefox for Android. 😞 e.g. browser.tabs.create({ url: 'about:blank', discarded: true }) https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/create#browser_compatibility

I checked the other options as well. Only url works.

utubo commented 2 months ago

Might be able to do it this way.πŸ€” Create foo.html.

<script>
document.addEventListener('visibilitychange', () => {
  if (document.visibilityState === 'visible') 
    location.href = location.search.substring(1);
});
</script>

Open foo.html?http://... in background.

utubo commented 2 months ago

v3.16 is released ! πŸŽ‰

Glaser-Martin commented 2 months ago

Works as desired. Thank you so much!