Skip to content

Sketches exported for web in Javascript Mode don't open in Chrome #798

Closed

Description

@processing-bugs

Original author: jer.blp...@gmail.com (June 26, 2011 00:42:15)

Sketches previewed in Javascript mode run fine in Chrome, but don't run when launched from the finder.

  1. Create a simple sketch.
  2. See that running the sketch works in Chrome
  3. Go to the sketch folder's applet_js directory
  4. Double click the index.html file
  5. Javascript output reads:

Unable to load pjs sketch files:
<sketchName>.pde ==> No content

Original issue: http://code.google.com/p/processing/issues/detail?id=759

Activity

  1. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From fjen...@gmail.com on June 28, 2011 06:53:16
    The actual error is:
    XMLHttpRequest cannot load file:///Users/fjenett/Desktop/sketch_jun28a/applet_js/sketch_jun28a.pde. Origin null is not allowed by Access-Control-Allow-Origin.

    This is normal Chrome behavior and the reason we added the preview server in the first place. Background is that local files are not treated to be related by Chrome (and others) so it fails with a security exception for the XHR (Ajax) request to that file which is how Processing.js loads the .pde files.

  2. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From fjen...@gmail.com on June 28, 2011 07:57:52
    Reading my comment above i realize that it probably did not make much sense to anyone. So, attempt #2:

    The .pde file is empty because Chrome blocks access to it. This happens for all files that it thinks do not come from the same domain and local files are treated the same way. This is a normal security measure.

  3. github-actions commented on Jun 18, 2021

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked as resolved and limited conversation to collaborators on Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions