[Webkit-unassigned] [Bug 257450] document.focus or window onblur not trigger util a mouse move or click user gesture happened when an url-scheme launch dialog shows
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon May 29 02:39:04 PDT 2023
https://bugs.webkit.org/show_bug.cgi?id=257450
--- Comment #1 from Jeason Xu <jeason.xu93 at gmail.com> ---
Here is demo code:
const launchSharingApp = (urlScheme) => {
if (!urlScheme) return;
const frameId = 'url-scheme-frame-id';
let tempIframe = document.getElementById(frameId);
if (!tempIframe) {
tempIframe = document.createElement('iframe');
tempIframe.id = frameId;
tempIframe.style.display = 'none';
document.body.appendChild(tempIframe);
}
tempIframe.contentWindow.location.href = urlScheme;
setTimeout(() => {
if (!document.hasFocus()) {
/** if lost focus very fast, it means broswer's own confirm dialog shows.
* User has no chance to touch other app */
console.log('app installed');
}
}, 50);
};
launchSharingApp('...')
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230529/d43c5ee9/attachment.htm>
More information about the webkit-unassigned
mailing list