gecko-dev/browser
Rob Wu 3644913b9c Bug 1498896 - Apply documentUrlPatterns to original target document when viewTypes is set r=mixedpuppy
Usually, documentUrlPatterns applies to the URL of the document where
the context menu is opened. In some cases, there is no document, such
as menus on browser UI (extension action buttons, tools menu, tabs).
In these cases, `documentUrlPatterns` matches the (active) tab's URL.

This causes ambiguity when `browser.menus.overrideContext` is used to
change the context to the "tab" context.
Before this patch, `documentUrlPatterns` applied to the tab's URL.
After this patch, `documentUrlPatterns` applies to the URL of the
document where the menu was opened, *if* `viewTypes` is also set.
Using this property is a strong signal from the extension that the menu
is meant to be shown in a document rather than browser UI, so extensions
can reasonably expect `documentUrlPatterns` to match the original
document's URL instead of the URL of the spoofed tab context.

There was no existing test coverage for documentUrlPatterns on tab
contexts, so this does not only add tests for documentUrlPatterns on
overridden contexts (browser_ext_menus_replace_menu_context.js), but
also documentUrlPatterns in normal tab contexts (browser_ext_menus.js).

Differential Revision: https://phabricator.services.mozilla.com/D9249

--HG--
extra : moz-landing-system : lando
2018-10-22 14:17:29 +00:00
..
actors Bug 1500020 - Update cert error page copy based on UX suggestions. r=nhnt11 2018-10-19 14:50:59 +00:00
app Merge mozilla-central to mozilla-inbound. a=merge 2018-10-20 13:32:54 +03:00
base Bug 1500818 - wait for focus and activate of new windows in BTU.waitForNewWindow, r=dao 2018-10-22 13:10:35 +00:00
branding Bug 1471657 - Update Nightly DMG background to high-res r=Dolske 2018-08-21 20:54:30 +00:00
components Bug 1498896 - Apply documentUrlPatterns to original target document when viewTypes is set r=mixedpuppy 2018-10-22 14:17:29 +00:00
config Bug 1495539 Set up MinGW-clang to track clang trunk r=ted 2018-10-18 09:09:53 -05:00
docs Bug 1498178 - Add in-tree documentation for the Quantum Bar r=mikedeboer 2018-10-19 13:45:19 +00:00
extensions Bug 1500699 - Update pdf.js to version 2.0.936. r=bdahl 2018-10-20 12:46:25 -04:00
fonts
installer Bug 1477669 - remove feed preview code and associated files/code, r=flod,mak,nika 2018-10-16 12:47:36 +00:00
locales Bug 1500553 - Add CFR preference UI to about:preferences r=flod,ursula,k88hudson 2018-10-20 12:38:08 +00:00
modules Backed out changeset 2c633215c514 (bug 1482055) for causing bug 1500505. 2018-10-19 13:32:56 -04:00
themes Merge mozilla-inbound to mozilla-central. a=merge 2018-10-20 13:10:23 +03:00
tools/mozscreenshots Bug 1373563 - More specific mozscreenshots cropping for PermissionPrompts and ControlCenter. r=johannh 2018-10-18 15:31:45 -07:00
.eslintrc.js
app.mozbuild
build.mk
confvars.sh Bug 1491419 - move --enable-bundled-fonts to moz.configure; r=nalexander 2018-10-01 14:51:28 -04:00
defs.mk
LICENSE
Makefile.in
moz.build Bug 1465251 - use PrioEncoder to encode Telemetry values for pilot project r=kmag 2018-09-09 00:23:52 +00:00
moz.configure Bug 1493315: Build config for dedicated profiles and downgrade protection. r=ted 2018-09-21 23:32:55 +00:00