w3c / webextensions

Charter and administrivia for the WebExtensions Community Group (WECG)
Other
579 stars 50 forks source link

Handle special URLs, avoid hard coding #473

Open hanguokai opened 8 months ago

hanguokai commented 8 months ago

In browsers, there are some common URLs that developers(users) want to open or detect. Currently developers can only hardcode these URLs. But different browsers may have significant differences.

The goal of this issue: It would be helpful if there was a consistent way to judge or open these URLs without hardcode.

This issue covers #470 which is just one of these special URLs.

Chrome Firefox Safari
New Tab Chrome
chrome://newtab/
Edge
edge://newtab/
Opera
chrome://startpageshared/
Vivaldi
chrome://vivaldi-webui/startpage
about:newtab favorites://
topsites:// (Legacy)
Homepage No URL No URL No URL
Default homepage No URL about:home No URL
Extensions management chrome://extensions/ about:addons No URL (In browser settings)
Extensions shortcuts chrome://extensions/shortcuts (for all) No independent URL (In about:addons) -
Extensions details chrome://extensions/?id=ext-id No independent URL (In about:addons) No URL (In browser settings)
Browser history chrome://history/ No URL (In a independent window) history://
Browser bookmarks chrome://bookmarks/ No URL (In a independent window) bookmarks://
Browser downloads chrome://downloads/ No URL (In a independent window) -
Browser settings chrome://settings/ about:preferences No URL (In a independent window)

Some use cases:

Another special case: the extension's store link or review link. Developers have recently discussed it. The link needs to be modified to a specific store link before each release. It is best that browsers support open this page (if the extension is not from a store like unpacked extensions or self hosted extensions, just ignore it or throw error).

To solve these problems, a flexible API is needed, and different browsers can support parts of functions.

fregante commented 8 months ago

Likewise, it would be nice to find non-scriptable HTTPS URLs like the ones in the Chrome Web Store:

dotproto commented 8 months ago

I've updated the table in the original issue description to include the user's current homepage and the browser's default homepage.

Rob--W commented 7 months ago

FYI in Firefox the meta-bug tracking requests related to opening special pages is at https://bugzilla.mozilla.org/show_bug.cgi?id=1269456

carlosjeurissen commented 7 months ago

The ability to open the extension shortcuts page has been discussed here: https://groups.google.com/a/chromium.org/g/extension-api-reviews/c/4Odm0D9FR_E

https://bugs.chromium.org/p/chromium/issues/detail?id=1173375

https://github.com/w3c/webextensions/issues/126