-
Notifications
You must be signed in to change notification settings - Fork 29
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
unable to use Clay in emulator #162
Comments
https://github.com/clach04/clay/tree/%23162/new_emulator_url has a demo that appears to not work for modern browsers. Its possible pushing data into an iframe may be a viable workaround. |
As I'm using a VM I tried Firefox version 55 and whilst it does not error and does update the URL to a data URI the windows content is blank (dark, so the CSS is loading) :( |
Same for 49.0.1 |
I'm trying to recall when/if Firefox worked with Clay as I know initially it targeted Chrome (I do recall issues with Firefox) |
Firefox 35.0.1 does not work with clay 1.0.4, errors on Version 54 does not work with dark screen as per above. |
So I ended up needing to use custom handlers with Clay and I was going to add some emulator detector code in place so that I could spawn a regular website URL rather than Clay. Using the custom actions made Clay work in the emulator (using Chromium as browser, I've not tried anything else). I.e. the following worked for Phone and Emulator on desktop:
NOTE clay modified to point to a server that is up |
@clach04 It looks like it took many twists and turns for you to get to a working state, can you summarize the proper way to get this all working these days? I have copied the code from your latest comment into my
I still get directed to the old broken S3 address in my default web browser. I imagine this is some simple Node issue that I'm not familiar with. Is there a straightforward series of steps you can provide for people to get Clay emulation working with minimal hacks? |
@mattrossman my Pebble sdk machine is kaput so best I can do is point you at what my notes indicate is a working branch with code that uses the above. https://github.com/clach04/pebble-rest-timer/commits/emu_clay I still use this app on my Pebble, I just can't debug it I saw some one had a docker image of the sdk/emulator but I'm not sure when I will get chance to play with it any time soon :-( |
@matthewtole if you are still getting the AWS url, then the pebble clay package you have is not hacked (correctly). I dug out my old vm and spent the last few hours remembering how pebble node packages work. I'm not convinced I have this all figured out in my head but I do have it working.
Let me know how you get on. I've not figured out how to make deliverable pebble-clay packages otherwise I'd attach to github for you to pull down. |
Thanks to clach04's help in pebble/clay#162
@clach04 I ended up finding a better solution I think. I ran into some hiccups with the instructions, but I eventually reached the point where Chrome was denying the redirect. I realized that I had already been able to reach this point simply by cloning that rest timer app you linked earlier. I noticed that you included a (modified) copy of the clay.js source in your repo, so there was no need to use any This was resolved by adding in this function to replace the HTML content of the current page from within the <script> rather than sending a redirect request. I published this modified version of With all this in place, I am able to see a working clay config page after issuing Thanks a bunch for helping out, now I can get back to work on my watchface! |
…mulator Resolves pebble#162 - data URI now loads in iframe
I've merged this into the S3 bucket that Rebble maintains. Thanks, @kennedn! |
This is due initially to the code being hard coded to to open http://clay.pebble.com.s3-website-us-west-2.amazonaws.com/ which has been offline for a while.
However I'm not clear the technique being used is possible since late 2017 with a change to Mozilla Firefox, https://blog.mozilla.org/security/2017/11/27/blocking-top-level-navigations-data-urls-firefox-59/ (also see bug https://bugzilla.mozilla.org/show_bug.cgi?id=1331351).
Hacking in a new URL (into https://github.com/pebble/clay/blob/master/dev/emulator.html ) results in an error in the debugger console in Mozilla Firefox:
I'm not yet clear why the emulator uses a web page and doesn't use a data URI like it does on the phone.
In the mean time for emulator debugging/testing I'm using a regular web page.
The text was updated successfully, but these errors were encountered: