H5 uses Url Scheme, to transmit information to ios, and H5 asynchronous request is blocked.

scene description

when the H5 page in app is opened and loaded, it transmits information to IOS through scheme protocol:

//
 window.location.href ="menhong://activityMoments"

question

The

above is equivalent to jumping to a "non-existent" page, which is only used to pass information to ios and ends up on the current H5 page. But ios will block asynchronous requests on the current H5 page, such as all images being requested, are blocked .

excuse me, if I still communicate through the scheme protocol, is there any way to solve this problem?

May.28,2021

I know something about this url schemes.
according to your code
should jump to the app corresponding to menhong, right? why stay on the current h5 page?


has been resolved, by creating and adding iframe tags, iframe's src is directed to your scheme protocol, so that ios can capture scheme, cutting the current page without jumping to the new page, and all requests are in progress.

 let iframe = document.createElement('iframe');
      const time=new Date().getTime();
      iframe.id = 'schemeUse'+time;
      iframe.src = scheme;
      iframe.height = '0';
      iframe.width = '0';
      iframe.frameborder = '0';
      const app = document.getElementById('app');
      app.appendChild(iframe);
      app.removeChild(iframe);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8eb6a-46fbb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8eb6a-46fbb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?