Issues using local HTML - web viewer does not post/receive messages or load html

Hi, once again local html files do not work in the web viewer.

Even if the visibility is on true

So if I set URL to index.html file stored in thunkable storage it displays a blance page am I the only one? IOS, and Android.

On IOS a big NSString error and on android blank screen.

Before this was not a problem but the height and width were on 0.

Now you have to set it to 1 to not have any problem.

Local files do not work, only hosting.

Hi, This is normal I still do not have an answer?

1 Like

You need to provide more details about your situation. What is your setup exactly and what is that you expect to happen but not happening?

I put the webviewer in visible at a normal size it displays all pages correctly but if I put a hosted page for example index.html with this code

<html><head>
<script src="https://thunkable.github.io/webviewer-extension/thunkableWebviewerExtension.js" type="text/javascript"></script>
<script type="text/javascript">
// when we get a message from the app, display it on the page
ThunkableWebviewerExtension.receiveMessage(function(message) {
 document.body.innerHTML = message;
});
</script>
<title>Facture</title>
</head>
<body>
</body>
</html>

when I send the message via thunkable nothing happens I have a blank page yet before the updates all worked perfectly, so the perfect example is this post

Create Invoice (Display on Thunkable live,Send by email with pdf attachment) - Thunkable Tutorials - Community

1 Like

Yes, this HTML script will not work and will not display anything.

Whatever the script is, it doesn’t seem to work, it worked fine before

1 Like

Try this script

<html>
<head>
<script src="https://thunkable.github.io/webviewer-extension/thunkableWebviewerExtension.js" type="text/javascript"></script>
<title>Facture</title>
</head>

<body>
<script>
// when we get a message from the app, display it on the page
ThunkableWebviewerExtension.receiveMessage(function(message) {
 document.body.innerHTML = message;
});
</script>
</body>
</html>
1 Like

It doesn’t work for me have you tried the script? On android
Local files like test.html or index.html inserted in the project files do not work in the webviewer. I have the impression to be the only one to have this problem.

Can you try to insert an html file to your project and try to read it with the webviewer ?

1 Like

See this quick project. It works for me
https://x.thunkable.com/projectPage/618d654435f88c011bf5beea

2 Likes

Thanks for the time but unfortunately it doesn’t work.

I’m on an Oppo reno 4 z 5g Android 11


There is nothing going on for me

1 Like

I did make more tests and you are right. It does not work all the time if the HTML file is local in the project. But it works from the computer.

@cassandra @domhnallohanlon can you please look into this?

Thanks, I have already tried to contact via the Thunkable chat but nobody answers me, the problem persists since 2 weeks.

1 Like

Follow up from your side and I will also follow up from my side and I’m confident Thunkable team will look into it.

1 Like

Hi, Any news about this bug? No one is notifying me about this problem

1 Like

Hey @oberon :wave:

Sorry you’re experiencing this issue. Could you DM me a project link and I’ll take a closer look for you! Be sure to provide answer to the questions below if you do send the link. It’ll help me diagnose the issue here.

A few questions:

is the device you’re testing this online at the time of testing?

What is the success rate on other devices using the same app?

Has it ever worked for you?

1 Like

Hi @jared

I can send you my link.

The app works fine if the HTML is referenced by URL. But if you add the HTML file to the project assets then the file will work and receive the parameters passed and can pass back any thing you give it but will not show text on the HTML page.

https://x.thunkable.com/projectPage/618d654435f88c011bf5beea

2 Likes

@oberon @muneer Thank you both for your work rooting out this issue. I have prepared a simple example for the team to analyze.

@cassandra @domhnallohanlon

I can verify this bug exists.

Here is a link to the project page. Oddly enough, the issue doesnt exist on the project page preview. Only in the ‘in editor’ preview and the companion app preview.

The bug is occurring when the HTML is packaged with the app. Although the HTML is displayed, it would seem that the scripts are not being ran on the page.

I have prepared this simplified example of this issue.
On screen 1, the label on the screen does not react to the button press from within the webviewer.
On screen 2, the label will change when a message is received from the webviewer.

the same HTML file is used in both screens but 1 is a local asset and the other is hosted on Github pages.

I am using an exact replica of the code provided on the Github page. I created a local copy by copy/pasting into VS code and loading the file into the app assets. I then uploaded a copy here to reference in the app as a comparison of local vs hosted HTML page.

1 Like

I did made a reference to both @domhnallohanlon and @cassandra but they seem to be very busy these days.

They are super busy these days. I’m sure they are attending to this behind the scenes. In the meantime, i have made a copy of this issue in the appropriate place over at GitHub.

Follow along below. When the bug is verified/fixed, we can update this forum post accordingly.

4 Likes