Prevent showing loading.jpg

  1. 7 years ago

    How can I prevent showing the file 'loading.jpg' upon loading a new page?

    This is the background of my question:

    When loading a new page, PubCoder briefly shows the file 'loading.jpg', which is a static screenshot of the page. Meanwhile, the true html page is loaded. Showing this static screenshot first, gives an impression of quick loading.

    Yet, this strategy has issues of its own:

    • As an iOS app: The screenshot is generated on a Mac, which has different font rendering from an iPad (on my Mac the text is somewhat fatter than on my iPad). Optically, this results in the text showing first fat (from the screenshot), and than thinning (as in the real rendering). This is not so nice.
    • As an Android app: there is a clear gap between the screenshot and the 'real' page, which is unsatisfactory
    • The screenshots are relatively large (200 kB in my case).

    I think I can do without the screenshot, but I don't see how to suppress it.

    The trick described by Carlton M. to suppress hidden objects, works for me:
    https://forum.pubcoder.com/209-hidden-objects-showing-breifly-on-load
    This generates a fully white screenshot. Yet, this workaround reduces the useability of the PubCoder editor and adds unnecessary markup and and extra fade-out.

    I also tried to suppress the rendering of loading.jpg with this custom CSS:

    .SCPreview {
        display: none;
    }

    As SCPreview seems to be the class of the image loading.jpg. This doesn't work. (Maybe I overlook something very simple, I am not an experienced coder)

    Any help or advice is greatly appreciated.

    Kind regards,
    Bram

  2. Paolo A

    30 Sep 2016 Administrator

    On any native app this is impossible, there is no possible workaround by code, as the image is managed natively (i.e. not via html). We should add an option in PubCoder as to whether you want or not the screenshot, and show it accordingly. Will add as requested feature in our roadmap. BUT there is one, probably very awkward, workaround. As you very wisely say, the screenshot is generated on the PC/Mac, but it is generated on the first "frame" of the page. By knowing this you could create a first blank/white layer on the page, with an interactivity of "on load" -> "hide" (maybe with a fade out effect) with one second delay. This way PubCoder should print out a blank/white screen, and you would get also a fadeout effect too.

  3. Many thanks. I didn't realize that showing 'loading.jpg' is done natively. It would be most helpful to be able to switch it on and off, so I appreciate that you have put it on the roadmap. Your workaround does work however (0.01 second as delay is enough).

    I have now used a variation of this workaround for hiding/showing the audio player. The audioplayer on the loading.jpg screenshot (generated on my Mac) is *very* different from the audioplayer shown in the iPad. Hiding the audioplayer for the first 0.01 second removes it from the screenshot and solves this problem.

 

or Sign Up to reply!