Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate when the proxied page is loading #155

Closed
seanh opened this issue Apr 19, 2021 · 4 comments · Fixed by hypothesis/via#465
Closed

Indicate when the proxied page is loading #155

seanh opened this issue Apr 19, 2021 · 4 comments · Fixed by hypothesis/via#465
Assignees
Labels

Comments

@seanh
Copy link
Collaborator

seanh commented Apr 19, 2021

When Via HTML is loading a third-party page in an iframe it should display some sort of "loading" placeholder in place of the iframe while the third-party page is still loading. See: hypothesis/via#443 (review)

@seanh
Copy link
Collaborator Author

seanh commented Apr 22, 2021

I think the browser might actually still show a spinner on the tab when the third-party site is loading in an iframe, so this may be a non-issue. I think very likely we should just close this @robertknight

@robertknight
Copy link
Member

I think the browser might actually still show a spinner on the tab when the third-party site is loading in an iframe, so this may be a non-issue.

From some quick testing on my Mac with https://publicvia.hypothes.is/https://www.bbc.co.uk/sport/football/56852632, it seems that Chrome, Firefox and Safari have different behavior in this regard. Chrome and Firefox show the tab in a loading state while the iframe is loading. In Safari on the other hand the loading indicator disappears as soon as the main tab is loaded and the user just sees a blank white space while the iframe content loads.

@robertknight
Copy link
Member

This can be implemented by extending the code added for #154. The proxied content sends a metadatachange message to the top frame once the DOMContentLoaded event is received in the viahtml page. The implementation I had in mind is for the top page to display some kind of loading indicator over the iframe and remove it once the first metadatachange notification is received.

@robertknight
Copy link
Member

It would be ideal if we could use the browser's native UI for this in Safari. Unfortunately there is no such API at present (maybe in future).

@robertknight robertknight self-assigned this Apr 28, 2021
robertknight added a commit to hypothesis/via that referenced this issue May 4, 2021
In Safari there is no indicator that anything is loading once the main
frame has loaded, the user just sees a blank white space where the
iframe is.

To provide a better experience add a loading spinner in the center of
the page above the iframe in all browsers. This is shown until the iframe reports the
document metadata to the parent frame for the first time, corresponding
to the `DOMContentLoaded` event having been received in the iframe. This
is also when the tab title gets set.

The loading spinner HTML and SVG have been taken from the
`annotation.html.jinja2`, `bouncer.css` and `hypothesis-icon.svg` files
in the hypothesis/bouncer repository. All of the resources have been
inlined here, which optimizes loading a little, but we could quite
easily move them to external resources in future for maintainability.

Fixes hypothesis/viahtml#155
robertknight added a commit to hypothesis/via that referenced this issue May 4, 2021
In Safari there is no indicator that anything is loading once the main
frame has loaded, the user just sees a blank white space where the
iframe is.

To provide a better experience add a loading spinner in the center of
the page above the iframe in all browsers. This is shown until the iframe reports the
document metadata to the parent frame for the first time, corresponding
to the `DOMContentLoaded` event having been received in the iframe. This
is also when the tab title gets set.

The loading spinner HTML and SVG have been taken from the
`annotation.html.jinja2`, `bouncer.css` and `hypothesis-icon.svg` files
in the hypothesis/bouncer repository. All of the resources have been
inlined here, which optimizes loading a little, but we could quite
easily move them to external resources in future for maintainability.

Fixes hypothesis/viahtml#155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants