MCPcopy Index your code
hub / github.com/ampproject/amphtml / openWindowDialog

Function openWindowDialog

src/open-window-dialog.js:18–34  ·  view source on GitHub ↗
(win, url, target, opt_features)

Source from the content-addressed store, hash-verified

16 * @return {?Window}
17 */
18export function openWindowDialog(win, url, target, opt_features) {
19 // Try first with the specified target. If we're inside the WKWebView or
20 // a similar environments, this method is expected to fail by default for
21 // all targets except `_top`.
22 let res;
23 try {
24 res = win.open(url, target, opt_features);
25 } catch (e) {
26 dev().error('DOM', 'Failed to open url on target: ', target, e);
27 }
28
29 // Then try with `_top` target.
30 if (!res && target != '_top' && !includes(opt_features || '', 'noopener')) {
31 res = win.open(url, '_top');
32 }
33 return res;
34}

Callers 15

handleActivationFunction · 0.90
openWindowMethod · 0.90
navigateToFunction · 0.90
openInternal_Method · 0.90
getIOSAppInfoFunction · 0.90
getAndroidAppInfoFunction · 0.90
openButtonClickedMethod · 0.90
openButtonClickedMethod · 0.90
exitMethod · 0.90
handleActivation_Method · 0.90

Calls 4

devFunction · 0.90
includesFunction · 0.90
openMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected