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

Fix Rio Journal URL in Via #1335

Open
chrisshaw opened this issue Mar 16, 2022 · 1 comment
Open

Fix Rio Journal URL in Via #1335

chrisshaw opened this issue Mar 16, 2022 · 1 comment
Labels
bug Frontend Issues that include frontend work via

Comments

@chrisshaw
Copy link

chrisshaw commented Mar 16, 2022

URL: https://riojournal.com/articles.php?id=8812

Support ticket: https://app.hubspot.com/contacts/6291320/ticket/810022493/

Via behavior: It looks like the page keeps trying to load an iframe over and over when loaded in Via:
image

Per @robertknight 's reply:

Via behavior: It looks like the page keeps trying to load an iframe over and over when loaded in Via:

I don't see this when visiting https://via.hypothes.is/https://riojournal.com/articles.php?id=8812. However there is an issue that there is an embedded copy of Hypothesis on the page, and an iframe with enable-annotation set, and some combination of those prevents the client from working.

When trying to annotate the page in Via, I see this error:

Guest RPC connection error

It looks like the Hypothesis code in the iframe is failing to connect to the sidebar/host parts of Hypothesis injected by Via.


(optional) Slack convo: https://hypothes-is.slack.com/archives/C2BLQDKHA/p1646926006015759

Originally posted by @mkdir-washington-edu in #1270 (comment)

@chrisshaw chrisshaw added the bug label Mar 16, 2022
@jon-betts jon-betts added the Frontend Issues that include frontend work label Mar 21, 2022
@robertknight
Copy link
Member

I see different results when testing in Chrome vs Safari/Firefox. In Safari and Firefox I see the nested frames as in the screenshot in the issue description. In Chrome I don't see this but the page has an inner iframe which fails to connect to the sidebar. The issue with the iframe not connecting to the sidebar is related to a window.postMessage override that pywb/wombat installs. There is a configuration option for Wombat that disables it:

diff --git a/viahtml/templates/head_insert.html b/viahtml/templates/head_insert.html
index 81679ae..b065e62 100644
--- a/viahtml/templates/head_insert.html
+++ b/viahtml/templates/head_insert.html
@@ -56,7 +56,9 @@ https://github.com/webrecorder/wombat/blob/3f04dcdcb071042d498c4912599454a15c11f
   wbinfo.wombat_scheme = "{{ urlsplit.scheme }}";
   wbinfo.wombat_host = "{{ urlsplit.netloc }}";
 
-  wbinfo.wombat_opts = {};
+  wbinfo.wombat_opts = {
+    skip_postmessage: true,
+  };
 
   if (window && window._WBWombatInit) {
     window._WBWombatInit(wbinfo);

With this change applied, the page works in Chrome. The issue persists in Firefox/Safari. I also haven't checked whether disabling the postMessage override is going to cause unwanted issues on other pages.

@lyzadanger lyzadanger added the via label May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Frontend Issues that include frontend work via
Projects
None yet
Development

No branches or pull requests

4 participants