iOS Safari App extension loading HTML from internal domain

Hello,

I would like to have some fringe information about ioS Safari App extensions.

My need is passing some HTML to the iOS Safari browser so a new tab or window is opened and the HTML rendered (and its Javascript executed, if any).

Being that this is not possible directly, and said that I need that the HTML is handled by Safari and not by a WKWebView or by a SFSafariViewController inside my app,

I thought about using an app extension.

This seems to be cumbersome, especially for the reaasons described here:

https://www.wildfire-corp.com/blog/to-apple-your-new-mobile-safari-extensions-are-great-can-opting-in-be-made-easier

I do not know if something has changed or will change, I did not dive in the extension development yet.

My idea is creating an extension with access to only a special domain, like html.myapp

The url would be https://html.myapp/37h238rd83dt2d2tr8fai33cf

When my app wants to open an url like that, Safari should open a window and start the extension, right?

open(url,options:options,completionHandler:handler)

The url contains a sort of query parameter that is a long string (bas64?) representing the entire HTML code, or a sort of unique ID.

The script has to display the HTML after extracting it from the url, or read some shared data between the app and the extension based on the ID.

After this point no other interaction is needed between the app and the app extension.

I would like to know if the Safari browser in fact can open the new window just on behalf of a special url like the above mentioned one, that is,

an url that does not point to a real web page, being that the domain is somehow "fake", although authorised from the Info.plist file.

The domain is just for enabling Safari to receive the entire url with HTML string or the unique ID.

So would the iOS Safari browser open the window, start the script and then display the HTML? And would all this be allowed by the submission review process?

Thanks in advance, Regards

PS

I know that it was better that Apple allows to pass securely some HTML from a registered iOS app to Safari, instead of this workaround, even with special info.plist keys, certificates or something like that.

iOS Safari App extension loading HTML from internal domain
 
 
Q