I am running into some issues when attempting to use documentUrlPatterns
with my web extension, on Safari, when creating context menu items.
Example:
browser.contextMenus.create({id: "12354", title: "Test01",documentUrlPatterns:["https://www.linkedin.com/feed/"]});
When using documentUrlPatterns
on any website with an explicit pathname
(as shown above), the context menu item does not get created for matching document urls.
With the above code I would expect to see a context menu item on https://www.linkedin.com/feed/
with the title Test01
, but nothing appears. As mentioned, it seems any explicit path name, such as /feed/
or /someother/page/
on any website presents this issue.
My understanding of how matching works makes me think that explicit path names are valid in patterns, but perhaps I am missing something.
If I drop the last trailing slash /
, the context menu item seems to be created as expected.
Is my expected outcome valid or is there something unique about the way documentUrlPatterns
works that I am missing?
The above code seems to work as intended in Chrome and Firefox. I imagine this could be an Apple Safari related bug but before reporting it, I was curious if there's something I am missing.