mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-02-11 17:55:49 +00:00
fix issue blocking
This commit is contained in:
parent
91a4f099c2
commit
460c71ef0e
@ -802,14 +802,14 @@ if (!window.hasAddedQortalListener) {
|
|||||||
window.hasAddedQortalListener = true;
|
window.hasAddedQortalListener = true;
|
||||||
//qortalRequests
|
//qortalRequests
|
||||||
const listener = async (event) => {
|
const listener = async (event) => {
|
||||||
event.preventDefault(); // Prevent default behavior
|
|
||||||
event.stopImmediatePropagation(); // Stop other listeners from firing
|
|
||||||
|
|
||||||
// Verify that the message is from the web page and contains expected data
|
// Verify that the message is from the web page and contains expected data
|
||||||
if (event.source !== window || !event.data || !event.data.action) return;
|
if (event.source !== window || !event.data || !event.data.action) return;
|
||||||
|
|
||||||
if (event?.data?.requestedHandler !== 'UI') return;
|
if (event?.data?.requestedHandler !== 'UI') return;
|
||||||
|
event.preventDefault(); // Prevent default behavior
|
||||||
|
event.stopImmediatePropagation(); // Stop other listeners from firing
|
||||||
await new Promise((res)=> {
|
await new Promise((res)=> {
|
||||||
chrome?.runtime?.sendMessage(
|
chrome?.runtime?.sendMessage(
|
||||||
{
|
{
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
// (function() {
|
|
||||||
// // Immediately disable qdnGatewayShowModal if it exists
|
|
||||||
|
|
||||||
|
|
||||||
// // Now, let's wrap the handleResponse function with the new condition
|
|
||||||
// const originalHandleResponse = window.handleResponse; // Save the original handleResponse function
|
|
||||||
|
|
||||||
// if (typeof originalHandleResponse === 'function') {
|
|
||||||
// // Create the wrapper function to enhance the original handleResponse
|
|
||||||
// window.handleResponse = function(event, response) {
|
|
||||||
// // Check if the response contains the specific error message
|
|
||||||
// if (response && typeof response === 'string' && response.includes("Interactive features were requested")) {
|
|
||||||
// console.log('Response contains "Interactive features were requested", skipping processing.');
|
|
||||||
// return; // Skip further processing
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Call the original handleResponse for normal processing
|
|
||||||
// originalHandleResponse(event, response);
|
|
||||||
// };
|
|
||||||
|
|
||||||
// console.log('handleResponse has been enhanced to skip specific error handling.');
|
|
||||||
// } else {
|
|
||||||
// console.log('No handleResponse function found to enhance.');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// })();
|
|
@ -1,28 +0,0 @@
|
|||||||
|
|
||||||
// (function() {
|
|
||||||
// console.log('External script loaded to disable qdnGatewayShowModal');
|
|
||||||
|
|
||||||
// const timeoutDuration = 5000; // Set timeout duration to 5 seconds (5000ms)
|
|
||||||
// let elapsedTime = 0; // Track the time that has passed
|
|
||||||
|
|
||||||
// // Poll for qdnGatewayShowModal and disable it once it's defined
|
|
||||||
// const checkQdnGatewayInterval = setInterval(() => {
|
|
||||||
// elapsedTime += 100; // Increment elapsed time by the polling interval (100ms)
|
|
||||||
|
|
||||||
// if (typeof window.qdnGatewayShowModal === 'function') {
|
|
||||||
// console.log('Disabling qdnGatewayShowModal');
|
|
||||||
|
|
||||||
// // Disable qdnGatewayShowModal function
|
|
||||||
// window.qdnGatewayShowModal = function(message) {
|
|
||||||
// console.log('qdnGatewayShowModal function has been disabled.');
|
|
||||||
// };
|
|
||||||
|
|
||||||
// // Stop checking once qdnGatewayShowModal has been disabled
|
|
||||||
// clearInterval(checkQdnGatewayInterval);
|
|
||||||
// } else if (elapsedTime >= timeoutDuration) {
|
|
||||||
// console.log('Timeout reached, stopping polling for qdnGatewayShowModal.');
|
|
||||||
// clearInterval(checkQdnGatewayInterval); // Stop checking after 5 seconds
|
|
||||||
// }
|
|
||||||
// }, 100); // Check every 100ms
|
|
||||||
|
|
||||||
// })();
|
|
@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
const script2 = document.createElement('script');
|
|
||||||
script2.src = chrome.runtime.getURL('disable-gateway-message.js'); // Reference the external script
|
|
||||||
document.documentElement.appendChild(script2); // Inject it into the page
|
|
||||||
script2.onload = function() {
|
|
||||||
script2.remove(); // Clean up after the script has been injected and run
|
|
||||||
};
|
|
@ -1,6 +0,0 @@
|
|||||||
const script = document.createElement('script');
|
|
||||||
script.src = chrome.runtime.getURL('disable-gateway-popup.js'); // Reference the external script
|
|
||||||
document.documentElement.appendChild(script); // Inject it into the page
|
|
||||||
script.onload = function() {
|
|
||||||
script.remove(); // Clean up after the script has been injected and run
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user