phcode-dev / phoenix

Phoenix is a modern open-source Code Editor for the web, built for the browser.
https://phcode.io
GNU Affero General Public License v3.0
1.66k stars 115 forks source link

did not preview any file #1858

Open 04474 opened 6 days ago

04474 commented 6 days ago

Describe the bug

did not preview my code having this Screenshot 2024-09-18 00 52 12 error

Reproduction

No response

Expected behavior

No response

OS, Browser and Phoenix versions

chromebook

logs or debug stack trace if any

No response

Additional context

No response

abose commented 6 days ago

Are you using the chromeos native app?

04474 commented 6 days ago

Yes

On Wed, Sep 18, 2024, 4:47 AM Arun Bose @.***> wrote:

Are you using the chromeos native app?

— Reply to this email directly, view it on GitHub https://github.com/phcode-dev/phoenix/issues/1858#issuecomment-2357434649, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUIDDTD2QXRLUK23GVC64RTZXDZTZAVCNFSM6AAAAABOMT6WYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJXGQZTINRUHE . You are receiving this because you authored the thread.Message ID: @.***>

abose commented 5 days ago

After a bit of investigation, it looks like making live preview work when offline in the browser is not possible. Since the current ChromeOS app is a packaged PWA, it will inherit the offline restriction from the browser.

The root cause is that the live preview is a thirdparty domain and lives inside a sandboxed iframe, which cannot use the offline cache and APIs browser wide across the domain due to the sandbox. So there is no way for us to cache the live preview loader pages in an iframe.

But we should be able to fix with with a proper native app for chromeos with a local server once we moved out of the packaged PWA builds for ChromeOS