Jujuyeh / webapp-creator

Ubuntu Touch Webapp Creator
9 stars 4 forks source link

Custom UA won't make any change #18

Closed tomoqv closed 7 years ago

tomoqv commented 7 years ago

I have created the following webapp using webapp-creator on my OPO (bacon) with UBports dev-channel. The install process appears to complete (see below), but I can't see the app on my phone. I have tried two different versions of the webapp, but the result is the same. The app accesses a https:// site.

Any ideas?

phablet@ubuntu-phablet:~$ sudo pkcon --allow-untrusted install-local homeassistant.tomoqv_0.2_all.click
[sudo] password for phablet: 
Installing files              [=========================]         
Finished                      [=========================]         
Installing files              [=========================]         
Starting                      [=========================]         
Finished                      [=========================]         
Installed       homeassistant.tomoqv-0.2. (installed:click,removable=1,app_name=homeassistant)  summary goes here

See below for the logfile from webapp-creator:

From file /home/phablet/.cache/upstart/application-click-webapp-creator.jujuyeh_webapp-creator_1.1.log:
Loading module: 'libubuntu_application_api_touch_mirclient.so.3.0.0'
file:///usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Components/1.3/ComboButton.qml:398:5: QML Scrollbar: Cannot anchor to an item that isn't a parent or sibling.
file:///usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Components/1.3/ComboButton.qml:398:5: QML Scrollbar: Cannot anchor to an item that isn't a parent or sibling.
file:///usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Components/1.3/ComboButton.qml:398:5: QML Scrollbar: Cannot anchor to an item that isn't a parent or sibling.
library "/vendor/lib/egl/libGLESv2S3D_adreno.so" not found
[PERFORMANCE]: Last frame took 45 ms to render.
QObject::startTimer: Timers cannot be started from another thread
Jujuyeh commented 7 years ago

Did you try installing the via OpenStore? When you tap "Create Webapp", it shows a screen with three options. Select the first one, Install or Save, and then tap OpenStore icon. It WILL NOT upload the app, it will only install it. ☺

tomoqv commented 7 years ago

Yes, that worked, but it doesn't show the icon.

tomoqv commented 7 years ago

Also, is there a way to "trick" the website that I am using a more modern browser? I have tried to update the user agent string and replace Chromium with Chrome, but it doesn't work for the site I am accessing.

Jujuyeh commented 7 years ago

What type of image did you select for the icon? The Apps scope won't show your icon if it's not a PNG or SVG image.

For the UserAgent, I recommend using Chrome for Android or Safari for iPhone. Just be sure you take the latest version of the browser.

tomoqv commented 7 years ago

Icon fixed, thanks. I am trying the UA string: Mozilla/5.0 (Linux, Android 6.0.1) AppleWebKit/537.36 Chrome/60.0.3112.107 Mobile Safari/537.36 but it doesn't render the whole web page.

cibersheep commented 7 years ago

Hi. Could you send us the click you created?

tomoqv commented 7 years ago

Unfortunately not, as it is an encrypted, password protected url for my home automation. There is a demo available here: https://home-assistant.io/demo/ but this demo displays fine on my OPO. There was an upgrade to the Home Assistant software about a week ago. Since, then it appears to no longer be compatible with some older browsers...

cibersheep commented 7 years ago

I understand. Then a couple of ideas:

tomoqv commented 7 years ago

marinUrl: check subURL: yes, tried that use https: check open in browser: yes, I should have included that the site doesn't work in a browser window either UA string: I have tried a few different ones, but no difference.

I can add that the url displays correctly in Chrome on my Nexus 4 with Android 5.1.1. The UA string of that phone is: Mozilla/5.0 (Linux; Android 5.1.1; Nexus 4 Build/LMY48T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36 I tried that UA string in my webapp, but to no avail. Maybe it is just the case of the web engine used in UBports that can't handle some modern websites?

tomoqv commented 7 years ago

Another question, where are the click packages hiding on the phone?

cibersheep commented 7 years ago

Thank you for all your time. I think we have a bug here, but if the site is not working with the UA string in the browser (Oxide, a fork of chromium) it will not work as a webapp because it uses the same Oxide to show the websites.

Then clicks are under /home/phablet/.cache/webapp-creator.jujuyeh/webappCreator/ You need to show hidden files and folder in File Manager. It should say in the install page (after creating a webapp). Otherwise upgrade to version 1.1, please :)

tomoqv commented 7 years ago

I don't know how to set a different UA string in the webbrowser-app, but it sounds reasonable that it must work there in order to work in a webapp. I am using v 1.1 by the way and it works really well. Just created another app for my home alarm. It would be nice to have the ability to reload the parameters from an already created app in order to continue work on it.

cibersheep commented 7 years ago

There's a little trick, after installing / saving or sharing, go back and most of the info will be there. In v1.5 will thought to add the feature of remembering your data ;)

Jujuyeh commented 7 years ago

It seems to be missing the quotes to define where the UserAgent and Provider start and end. It may be fixed with this commit.

tomoqv commented 7 years ago

Will this be in an update soon or do I have to do something else to test it?

Jujuyeh commented 7 years ago

We will release an update as all issues marked for milestone 1.2 are closed. Could you send me the .click file of your webapp? I'll try to fix it and then test it.

tomoqv commented 7 years ago

The problem is that I can't send you the click package, because you need to log in to my home automation (which is hosted on a Raspberry Pi) to test it. I think you understand that I don't want to give out the login details for this...

Jujuyeh commented 7 years ago

Oh, OK. Then, you should wait until we release Webapp Creator 1.2 with the proper fixes.

cibersheep commented 7 years ago

Fixed committed. Webapp Creator 1.2 will be released soon