Debug Milo in Safari #1226
TsayAdobe
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
A simpler way is to setup https on your local - see "Setting up HTTPS for localhost": |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In light of the recent critical system outage on the Safari browser, I have written this show-and-tell on debugging in this browser.
For Chrome, you only need to run the command to use Milo in the local server, which runs on port 6456.
To debug a page, add the query parameter to the URL.
The standard
setLibs
function in a consumer project has the logic to use the local server for the Milo libraries if the query parameter is specified.However, this setup does not work for Safari due to the browser's security restrictions. Apple believes that any content from http should not be treated as secure, making debugging in Safari challenging.
https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content
https://bugs.webkit.org/show_bug.cgi?id=171934
To workaround it, you should set up a local SSL proxy. This NPM package can be installed globally or in the project. Start Local SSL Proxy with the following command:
It opens a local https on port 6457, which proxies the port 6456. The NODE_OPTIONS is required for the latest NodeJS.
In the
setLibs
function, you may want to add the condition to use the secure port.Now, you can add the query parameter to the page URL.
Finally, add
https://localhost:6457/
to the page's content security policy, similar tohttp://localhost:6456/
.Beta Was this translation helpful? Give feedback.
All reactions