Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Message Passing via webviewer not working when HTML is packaged with app #1064

Open
jaredgibb opened this issue Nov 20, 2021 · 4 comments
Open
Labels
bug Something isn't working follow up Thunkable to follow up

Comments

@jaredgibb
Copy link

jaredgibb commented Nov 20, 2021

Here is a link to the project page. Oddly enough, the issue doesn't 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 in the webviewer, it would seem that the JS scripts are not being ran on the packaged page.

I have prepared this simplified example of this issue.
On screen 1 (using a packaged HTML page) the label on the screen does not change when the button is press from within the webviewer.
On screen 2 (using a hosted HTML page) , the label will change when the button is pressed from within 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.

@casstang05
Copy link

Thanks for laying this out so clearly @jaredgibb - we're looking into it!

@josmas
Copy link
Contributor

josmas commented Nov 23, 2021

hey @jaredgibb thanks for the detailed report. Would you know if this is specific to STP/legacy projects?
Just starting to look into it, I can repro for the project provided, but DND seems fine on preview for both hosted and http html. Will focus on STP for now.

@josmas josmas added bug Something isn't working follow up Thunkable to follow up labels Nov 23, 2021
@jaredgibb
Copy link
Author

I haven’t experienced it otherwise but will follow up with tests on my end this week and get back to you!

@ealalin
Copy link

ealalin commented Dec 4, 2021

jaredgibb ; I use your example and your example is working , thankx for that.
When I call your HTML file from github , then I receive the information back from the html into thunkable , it 's just what I need to proceed further
Https://github.com/thunkable/webviewer-extension/blob/master/examples/simple.html

Now I want to use my HTML from :
HTML file from Github 2021-12-04

I have try the following https call
https://thunkable.github.io/webviewer-extension/examples/simple.html
https://octocat.github.io/ealalin/Tunkable-webviewerMessages/Webviewer-1.html
and others.... none of them are working.

I can see my HTML file with a copy permalink

https://github.com/ealalin/Thunkable-webviewerMessages/blob/18c1bb1f7b126122ca0b74e6a3093fad6883475e/Webviewer-1.html

But what I need is the answer of a running HTML.
Must I reserve a domain name to be abble to do it ?
I miss something can you give me the way to follow ?
sorry if my questions are not relevant but this domain is new to me.

best regards
ealalin1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working follow up Thunkable to follow up
Projects
None yet
Development

No branches or pull requests

4 participants