Split "page" context menus from links
As far as Firefox is concerned, a context menu entry on the page itself has no
"target" and so any targetUrlPatterns
will cause the menu entry not to show.
This patch splits the "page" context from anything with a link or source, so that
we can set targetUrlPatterns
for those, and documentUrlPatterns
for the "page"
menu. This has the added benefit of not allowing to share internal browser pages,
such as "New Tab", while still allowing to send http(s) links on those pages.
While at it, also support the "tab" context in Firefox which adds an entry to the tab button on the tab bar.
Both Chrome and Firefox:
- Right clicked on empty space of kde.org website, got a "Open on device" entry again (the bug this patch mainly is supposed to fix on Firefox)
- Right clicked on link on kde.org website, got "Open on device" entry
- Right clicked on empty space of "New Tab" page, got no entry (added benefit of splitting the two)
- Right clicked on a link to some search provider thing on "New Tab" page, got no entry
- Right clicked on a link to some website on "New Tab" page, got "Open on device" entry
- Right clicked on tel: link on some website, got "Call on device" entry
- (Firefox only) Right clicked on the tab button of a "kde.org" tab, got "Open on device" entry
- (Firefox only) Right clicked on the tab button of "New Tab" tab, got no device entry
- Verified that disabling and enabling the kde connect feature in settings (basically simulating a device unpair and pair) removes and re-adds the entries without errors
Edited by Kai Uwe Broulik