Private_Tab icon indicating copy to clipboard operation
Private_Tab copied to clipboard

Transition to WebExtensions (aka compatibility with Firefox 57+)

Open dralley opened this issue 8 years ago • 26 comments

As I'm sure you know, in November 2017, the Firefox 57 release will disable all addon APIs with the exception of the new WebExtensions API. Are there any plans for undertaking this transition, or auditing whether it is possible at all, or would require Mozilla extending the WebExtensions API to provide the necessary functionality?

dralley avatar Mar 22 '17 17:03 dralley

See all the other open bugs about compatibility: https://github.com/Infocatcher/Private_Tab/issues?q=is%3Aissue+is%3Aopen+label%3Acompatibility

@Infocatcher has devoted a lot of time on this, but Mozilla isn't cooperating.

anewuser avatar Mar 23 '17 20:03 anewuser

Any privilege is requirements more than https://github.com/mozilla/testpilot-containers/blob/master/webextension/manifest.json?

yfdyh000 avatar Apr 17 '17 15:04 yfdyh000

Required API for private tabs or access to browser internals...

Infocatcher avatar Apr 17 '17 16:04 Infocatcher

OK, let's see: https://bugzilla.mozilla.org/show_bug.cgi?id=1358058

Implement WebExtensions API for private tabs

Infocatcher avatar Apr 20 '17 09:04 Infocatcher

@Infocatcher check these out:

https://github.com/mozilla/testpilot-containers/issues/47 https://github.com/mozilla/testpilot-containers/issues/419 https://github.com/mozilla/testpilot-containers/issues/429

anewuser avatar Apr 26 '17 04:04 anewuser

mozilla/testpilot-containers#47 mozilla/testpilot-containers#419 mozilla/testpilot-containers#429

Interesting, thanks! Also "private containers" will solve issue about only one global private storage/container.

Infocatcher avatar Apr 30 '17 20:04 Infocatcher

OK, let's see: https://bugzilla.mozilla.org/show_bug.cgi?id=1358058

Implement WebExtensions API for private tabs

And, probably, that's all. Nothing about any feedback, lack of discussion.

https://bugzilla.mozilla.org/show_bug.cgi?id=1358058#c12

Status: RESOLVED WONTFIX

Infocatcher avatar Jun 08 '17 06:06 Infocatcher

Also to inherit private state of opener tab: https://bugzilla.mozilla.org/show_bug.cgi?id=1238314 Implement browser.tabs opener functionality

Infocatcher avatar Jun 20 '17 14:06 Infocatcher

Maybe a noob question (don't judge me I know nothing about coding 😫) - how come Brave has private tabs and it's based on Chromium/Blink?

bastadur avatar Jul 20 '17 07:07 bastadur

@bastadur That's a question you should ask the Brave developers.

anewuser avatar Jul 20 '17 20:07 anewuser

Some tests around WebExtensions: https://github.com/Infocatcher/Private_Tab_WE Actually does nothing for now, only have a dummy menu item in page context menu.

Infocatcher avatar Aug 14 '17 18:08 Infocatcher

https://bugzilla.mozilla.org/show_bug.cgi?id=1354602 Not yet fixed, user should set privacy.userContext.enabled = true manually.

Still missing really private containers, but https://bugzilla.mozilla.org/show_bug.cgi?id=1353726 Consider extending browsingData.RemovalOptions to allow removal by cookieStoreId (not implemented)

Not implemented: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/onSuspend https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/onSuspendCanceled So, as I see, there is no way to perform some cleanup, if extension was disabled/uninstalled.

Also I not see any way to create configurable keyboard shortcuts, only hardcoded ones: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/commands And limited:

ERROR Loading extension 'privateTabWE@infocatcher': Reading manifest: Error processing commands.openNewPrivateTab.suggested_key.default: Value "Ctrl+Alt+P" must either: match the pattern /^\s*(Alt|Ctrl|Command|MacCtrl)\s*+\s*(Shift\s*+\s*)?([A-Z0-9]|Comma|Period|Home|End|PageUp|PageDown|Space|Insert|Delete|Up|Down|Left|Right)\s*$/, match the pattern /^\s*((Alt|Ctrl|Command|MacCtrl)\s*+\s*)?(Shift\s*+\s*)?(F[1-9]|F1[0-2])\s*$/, or match the pattern /^(MediaNextTrack|MediaPlayPause|MediaPrevTrack|MediaStop)$/

Infocatcher avatar Aug 15 '17 21:08 Infocatcher

Also I not see any way to create configurable keyboard shortcuts, only hardcoded ones

https://bugzilla.mozilla.org/show_bug.cgi?id=1303384 UI for re-assigning command shortcuts (not implemented for now)

Infocatcher avatar Aug 16 '17 20:08 Infocatcher

No easy way to inherit browser.tabs.insertRelatedAfterCurrent = true behavior, only ability to set tab position https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/create#Parameters

browser.tabs.create({
	url: …,
	cookieStoreId: …,
	active: true,
	index: …
});

No ability to inherit browser settings to open in active/background tab.

Infocatcher avatar Aug 18 '17 19:08 Infocatcher

https://hacks.mozilla.org/2017/10/containers-for-add-on-developers/

anewuser avatar Oct 03 '17 19:10 anewuser

https://hacks.mozilla.org/2017/10/containers-for-add-on-developers/

Thanks! So, it's possible to do something like before, but "private" container should be removed manually after closing of last private tab.

Infocatcher avatar Oct 04 '17 17:10 Infocatcher

This one says that it can remove them automatically: https://addons.mozilla.org/addon/containers-on-the-go/ . It's a shame that its developer hasn't posted it on a public repository though. You could work together.

You may get inspiration from this too: https://github.com/totallymike/contextPlus

anewuser avatar Oct 05 '17 00:10 anewuser

Тут много всего написано и не всё я понимаю. Можно резолюцию: есть перспективы у этого расширения для переезда на Firefox 57 или нет?

inoyakaigor avatar Oct 05 '17 09:10 inoyakaigor

@inoyakaigor никто пока не понимает. :) Но уже есть прототип https://github.com/Infocatcher/Private_Tab_WE и там внизу таблица тикетов, которые надо разрешить, чтобы все заработало

Tallefer avatar Oct 05 '17 10:10 Tallefer

This one says that it can remove them automatically

Yes, that's easy (and now implemented), but the most important part is about private containers: https://bugzilla.mozilla.org/show_bug.cgi?id=1353726 or (and better) private flag for container itself.

@inoyakaigor По-прежнему со стороны браузера не реализована основная часть: нет ни возможности удаления истории, привязанной к контейнеру (https://bugzilla.mozilla.org/show_bug.cgi?id=1353726), ни (тем более) настоящих приватных контейнеров.

Infocatcher avatar Oct 05 '17 13:10 Infocatcher

https://github.com/mozilla/multi-account-containers/issues/47 Disable history per-container setting

Edit: oh, already listed some posts above...

Infocatcher avatar Oct 05 '17 13:10 Infocatcher

From https://github.com/Infocatcher/Private_Tab_WE#issues

Ability to move tab into another container (for “Private Tab” checkbox in tab context menu), to restore not only URL

This can be implemented via Context Plus extension.

MurzNN avatar Jan 04 '18 21:01 MurzNN

This can be implemented via Context Plus extension.

As I see, this is only about browser.tabs.create({ cookieStoreId }) to create new tab in desired container (and preserve only URL, tab position and active/inactive state) + browser.tabs.remove() to close initial tab: context_plus-0.5.0-an+fx-windows.xpi\contextPlus.js

    const onClickedHandler = async function(info, tab) {
      if (contextStore.hasOwnProperty(info.menuItemId)) {
        const moveTab = !(info.modifiers && info.modifiers.includes("Ctrl"));
        const cookieStoreId = contextStore[info.menuItemId];
        const { active, index, pinned, url, windowId } = tab;

        const newTabPromise = browser.tabs.create({
          active,
          cookieStoreId,
          index: index + (moveTab ? 0 : 1),
          pinned,
          url,
          windowId,
        });
        if (moveTab) {
          await newTabPromise;
          browser.tabs.remove(tab.id);
        }
      }
    };
    browser.contextMenus.onClicked.addListener(onClickedHandler);

Infocatcher avatar Jan 05 '18 20:01 Infocatcher

There's a new related extension:

https://addons.mozilla.org/addon/temporary-containers/

https://github.com/stoically/firefox-add-on-temporary-containers/

Check it out and see the comment I've left on https://github.com/stoically/firefox-add-on-temporary-containers/issues/17

anewuser avatar Jan 27 '18 01:01 anewuser

Firefox 61 allows to interact with Tabs via WebExtension, is that any help?

ShalokShalom avatar Aug 27 '18 12:08 ShalokShalom

If you guys use the stable version of Firefox and are still interested in private tabs, I recommend this new lightweight extension: https://addons.mozilla.org/addon/open-in-temp-container/ .

You need to go to the Firefox Add-ons Manager to see its options and make the toolbar button open new tabs. You can also give it permission to access your browsing history to prevent new URLs from being stored.

anewuser avatar Mar 14 '24 20:03 anewuser