This repository has been archived by the owner on Mar 14, 2023. It is now read-only.
Differences between Web and Mobile and usage limitations #27
Labels
documentation
Improvements or additions to documentation
Hello, here I'll try to create a helpful guide with all the differences I can find between the two and a variety of use cases when one can not bypass the intrinsic limitations of the package, since this is not really obvious from the documentation.
This will be updated from time to time. Here we go:
The Web version (iframe):
Can accept 3 types of content:
SourceType.urlBypass
for this). The package treats theese pages as follows:At the moment, it behaves much better than the initial version but still, one should NOT use it (especially with
SourceType.urlBypass
) for security-related stuff, such as OAuth or similar. This is because:Calling any method that will interact with the page's source (i.e. call JS methods, callbacks, execute JS etc) from the controller only work when using
SourceType.urlBypass
orSourceType.html
. This is because only in theese 2 situations the package can actually inject that JS code inside the page source. When usingSourceType.url
, iframe's content does not actually belong to us - it is loaded from a different domain so we're not allowed to do that.You can supply your own list of
BypassProxy
objects in the WebViewX'swebSpecificParams
param.The
headers
only have effect when usingSourceType.urlBypass
, because that's when the package fetches the page source.'NavigationDelegate' only has effect when using
SourceType.urlBypass
because click handlers can only be registered for this type of source (for now, soon they may also work when usingSourceType.html
- seesrc/view/impl/web.dart
around line 220)In the
EmbeddedJsContent
param on the WebViewX, if you define JS functions as ES6 variable functions:const fn = () => ...
, then you also need to add them to the global scope to work:window.fn = fn
.URLs which redirect to another URL won't work by using
SourceType.urlBypass
. Redirects may work only if that website allows iframe embeddings, in which case you should useSourceType.url
.The text was updated successfully, but these errors were encountered: