Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to load script javascript on webview does not work. #219

Closed
pathapong opened this issue Dec 12, 2019 · 3 comments
Closed

How to load script javascript on webview does not work. #219

pathapong opened this issue Dec 12, 2019 · 3 comments

Comments

@pathapong
Copy link

I encountered a problem with the application that the inappwebview webview does not load scripts such as Javascript and others do not work.
I want to know that How should it be fixed? How to get the script to load.
The example below
78762799_570242057162569_184701937533321216_n

Thank you

@pichillilorenzo
Copy link
Owner

Please, next time use the issue template when you create an issue here. I created it to be used as it gives me useful information in order to debug the plugin.

However, can you post the code you are using? Maybe there are some options that breaks your javascript code.
Also, in your initialOptions try to add:

...

initialOptions: InAppWebViewWidgetOptions(
    inAppWebViewOptions: InAppWebViewOptions(
      debuggingEnabled: true,
    ),
    androidInAppWebViewOptions: AndroidInAppWebViewOptions(
      domStorageEnabled: true
    )
),

...
  • domStorageEnabled is used to enable DOM storage API on Android
  • debuggingEnabled to enable debugging on Android using the Chrome Browser to inspect the WebView and see if there are some javascript errors (URL to use on Chrome: chrome://inspect/#devices). On iOS, it is always enabled and you need to use Safari.

@pathapong
Copy link
Author

androidInAppWebViewOptions: AndroidInAppWebViewOptions(
      domStorageEnabled: true
    )

Thank you for the answer. @pichillilorenzo

This was referenced Jul 6, 2020
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants