Know in content script if inpage is available

This commit is contained in:
Ivan Grachev 2022-08-30 15:25:37 +03:00
parent b0d8987889
commit a2974e34e9
3 changed files with 5 additions and 1 deletions

View File

@ -182,6 +182,8 @@ window.addEventListener("message", function(event) {
const cancelRequest = event.data;
document.pendingRequestsIds.delete(cancelRequest.id);
browser.runtime.sendMessage(cancelRequest);
} else if (event.data.inpageAvailable) {
document.inpageAvailable = true;
}
}
});

File diff suppressed because one or more lines are too long

View File

@ -107,6 +107,8 @@ function deliverResponseToSpecificProvider(id, response, provider) {
// MARK: - Tokenary overlay for iOS
window.postMessage({inpageAvailable: true}, "*");
window.tokenary.overlayTapped = () => {
const request = window.tokenary.overlayConfigurations[0].request;
window.tokenary.overlayConfigurations.shift();