ContentWorld class Null safety
NOTE for iOS: available on iOS 14.0+. This class represents the native WKContentWorld class.
NOTE for Android: it will create and append an
<iframe> HTML element with
id attribute equals to
to the webpage's content that contains only the inline
Unfortunately, there isn't any other way to do it.
There are some limitations:
- for any ContentWorld, except ContentWorld.PAGE (that is the webpage itself), if you need to access to the
documentglobal Object, you need to use
window.top.documentbecause the code runs inside an
- also, the execution of the inline
<script>could be blocked by the
- DEFAULT_CLIENT → ContentWorld
The default world for clients.
- PAGE → ContentWorld
The content world for the current webpage’s content.
This property contains the content world for scripts that the current webpage executes.
Be careful when manipulating variables in this content world.
If you modify a variable with the same name as one the webpage uses, you may unintentionally disrupt the normal operation of that page.