WIP: feat(menu): add link menu item option #867
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a link option to menu items which is either a string (the URL) or an object of
{href, target, opener, referrer}
such as{href: 'somepage.html', target: '_blank'}
. Theopenener
andreferrer
options are only needed to open windows in the same process, which gives that page access towindow.opener
andwindow.opener.document
(those should be omitted in almost all cases).This is all to address various problems with
window.open
that make it an anti-pattern in JS.WIP because:
goog.window.open
. Pretty sure this one is replaceable with further investigation.os.openPopup
may be a legitimate use ofwindow.open
, and I'm unsure how to either make that an exception to a conformance violation or implement that differently<a>...</a>
are not styled correctlya:hover
style, while none of the other options are not (not sure if bug or feature)Also, should we indicate that external links are external (a la Wikipedia)? Should we also force those links into a new tab?