New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 697835 link

Starred by 1 user

Issue metadata

Status: Unconfirmed
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

chrome.contextMenus.create(). "documentUrlPatterns" not used

Reported by berkut.u...@gmail.com, Mar 2 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce the problem:
1. Create file "manifest.json":

{
"background":{"persistent":false,"scripts":["background.js"]},
"page_action":{},
"permissions":["tabs","contextMenus"]
}

2. Create file "background.js":

chrome.contextMenus.create(
{
id:"id",
title:"title",
contexts:["page_action"],
documentUrlPatterns:["https://example.com/*"]
}
);

3. Install created extension.
4. Press extension icon.

What is the expected behavior?
Context menu item must be displayed only if url of current tab matched given pattern ("https://example.com/*").

What went wrong?
Field "documentUrlPatterns" ignored for "page_action"'s and "browser_action"'s context menu.

Did this work before? N/A 

Chrome version: 56.  Channel: stable
OS Version: 
Flash Version:
 
Cc: hdodda@chromium.org
Labels: Needs-Feedback
Tried to install the extension with the given code snippet and got the error with the manifest file.

Attached screenshot of the error.

@berkut.ula.p-- Could you please check the screenshot and provide us the sample test file with all the code snippet included and also the screenshot of the expected or actual result, that would help us in traiging the issue better .

Thanks!
697835.png
338 KB View Download

Comment 2 by ajha@chromium.org, Mar 9 2017

Labels: Needs-Triage-M56
Content of "manifest.json" (added keys "name", "version" and "manifest_version"):

{
  "name": "Extension name",
  "version": "0",
  "manifest_version": 2,
  "background": {
    "persistent": false,
    "scripts": [ "background.js" ]
  },
  "page_action": {},
  "permissions": [
    "tabs",
    "contextMenus"
  ]
}

In screenshot menu item with title "title" displayed for page "chrome://extensions", but must be displayed only on pages "https://example.com/*", as specified in "documentUrlPatterns".
Issue-697835.png
42.7 KB View Download
Project Member

Comment 4 by sheriffbot@chromium.org, Aug 23 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "hdodda@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: Platform>Extensions

Sign in to add a comment