Navigation

    APPDRAG Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular

    REMINDER

    Please be respectful of all AppDragers! Keep it really civil so that we can make the AppDrag community of builders as embracing, positive and inspiring as possible.

    Previewing HTML locally

    Cloud CMS (Pagebuilder, Blog, Shop, Newsletters, Code Editor)
    pagebuilder local download html cors
    2
    3
    384
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Daniel Mulroy
      Daniel Mulroy last edited by Daniel Mulroy

      For certain rapid development scenarios, I would prefer to download one of my pages and edit it locally with VS Studio, etc.

      This is mostly to work on the javascript side, not editing the HTML.

      However, when trying to preview the page locally, I am getting an error with loading certain resources.

      Are there changes to the CORS policies or other technical aspects of the page before it will allow you to run the page locally?

      Here is an excerpt from the code that is failing:

      <link rel="stylesheet" type="text/css" href="//cf.appdrag.com/resources/appallin-universal-theme.css">
      <link rel="stylesheet" type="text/css" href="//s3-eu-west-1.amazonaws.com/dev.appdrag.com/resources/css/appdrag.css">
      // THIS ONE IS FAILING -> <link rel="stylesheet" crossorigin="anonymous" id="appdrag-palette" type="text/css" href="//app.goodvibes.news/css/appdrag-palette.css">
      <link rel="stylesheet" type="text/css" href="//app.goodvibes.news/fonts/fonts.css">
      

      UPDATE:
      Inspecting the request, it was using http, which was failing. Manually changing the request url to https caused it to work.

      Do you know why that one request was being made insecurely? The others were secure, even with the prefix "//url.to.file/"

      1 Reply Last reply Reply Quote 0
      • Wassim
        Wassim last edited by

        Hello Daniel,

        When using "//" the browser will use http:// when you're on http protocol and https:// on https. What happened might be that all requests went through http because you're local testing but only app.goodvibes.news/css/appdrag-palette.css requires cors headers to allow loading on http.

        Manually prepend https: where it doesn't work seems to be the solution!

        Daniel Mulroy 1 Reply Last reply Reply Quote 1
        • Daniel Mulroy
          Daniel Mulroy @Wassim last edited by

          @wassim Brilliant! Merci to you Wassim!

          1 Reply Last reply Reply Quote 1
          • First post
            Last post