block moz-extension from history?

RESOLVED WORKSFORME

Status

()

Toolkit
WebExtensions: Request Handling
P3
normal
RESOLVED WORKSFORME
10 months ago
18 days ago

People

(Reporter: mixedpuppy, Unassigned)

Tracking

({dev-doc-complete})

49 Branch
dev-doc-complete
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [history]triaged)

(Reporter)

Description

10 months ago
Researching for something else, I ran across code that blocks various internal schemes from history.  Should moz-extension be added to that list?

https://dxr.mozilla.org/mozilla-central/source/toolkit/components/places/nsNavHistory.cpp#1146

https://dxr.mozilla.org/mozilla-central/source/mobile/android/components/build/nsAndroidHistory.cpp#377

Comment 1

10 months ago
Probably not. We already disable history in background and popup browsers. The URLs that actually open in tabs probably belong in history.

Updated

10 months ago
Priority: -- → P3
Whiteboard: triaged

Updated

10 months ago
Whiteboard: triaged

Updated

10 months ago
Component: WebExtensions: Untriaged → WebExtensions: Request Handling
Whiteboard: [history]triaged
Maybe this should just be documented in MDN for browser.extension.getURL that the following code fixes this use case.

browser.tabs.create({url: confirmUrl, cookieStoreId: `firefox-container-${userContextId}`, index}).then(() => {
  // We don't want to sync this URL ever nor clutter the users history
  browser.history.deleteUrl({url: confirmUrl});
}).catch((e) => { throw e });

Another option would be to make tabs.create have the ability to prevent history but probably that would be unreliable.

Seems a shame that the above use-case would require a "history" permission though as it's managing the extension pages history only.

Comment 3

2 months ago
Marking as wont fix based on comment 1, we don't really know why a user opened a moz-extension page, but its a page opened in the browser, let's keep it around.

Added dev-doc-need to see if its worth comment as per comment 2.
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Keywords: dev-doc-needed
Resolution: --- → WORKSFORME
This page: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/user_interface/Bundled_web_pages seemed like the best place to put it:

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/user_interface/Bundled_web_pages#Bundled_pages_and_history

Let me know if this covers it.
Flags: needinfo?(jkt)
Looks good to me thanks for this :wbamberg!
Flags: needinfo?(jkt)
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.