pdfernhout / narrafirma

Single-page web app for Participatory Narrative Inquiry (PNI)
25 stars 9 forks source link

Preview the question form doesn't display in Chrome #8

Closed eliza411 closed 8 years ago

eliza411 commented 8 years ago

The "Preview question form" link on the Design story forms page leads to something like: http://localhost:8080/survey.html#preview=2015-10-23T01:32:31.854Z and is always blank in Chrome Version 45.0.2454.93 (64-bit) on Debian. It displays fine in IceWeasel/Firefox.

pdfernhout commented 8 years ago

@eliza411 The "Preview Question Form" seemed to work OK in Chrome for me on Mac OS X 10.6.8 with these two slightly later Chrome versions: Version 46.0.2490.71 (64-bit) Version 46.0.2490.80 (64-bit)

Are there any suspicious related console log messages (View / Developer / JavaScript Console) for either the main application window or the preview window?

There probably should not be anything logged for the button action in the main application console.

Here are what the messages look like for me for the preview window's console:

window.location.href [http://LOCATION]/wordpress/wp-content/plugins/narrafirma/webapp/survey.html#preview=2015-10-24T01:40:07.839Z
survey.html:39 set ajaxurl to [http://LOCATION]/wordpress/wp-admin/admin-ajax.php
survey.html:55 started loading... Fri Oct 23 2015 21:40:07 GMT-0400 (EDT)
bundle-survey.js:3750 configuration Object
bundle-survey.js:3753 Preview mode
bundle-survey.js:3736 turned off please wait at Fri Oct 23 2015 21:40:07 GMT-0400 (EDT) still waiting to display true
bundle-survey.js:3304 buildSurveyForm questions Object
bundle-survey.js:3370 startQuestions Array[2]

Otherwise I'll have to fire up VirtualBox and see what I can see. But with FireFox working and one Chrome version working, I can wonder if the code is tickling some Chrome bug somewhere perhaps related to window.opener?

The code passes around a story form (internally called a questionnaire) from one window to another. Essentially, the main application sets: window["narraFirma_previewQuestionnaire"] = questionnaire; and the survey application (an opened child window) should get that value via: var questionnaire = window.opener["narraFirma_previewQuestionnaire"]; Some console log statements added strategically in the initialize function for survey-main-mithril.ts/.js might help determine what is going wrong, including to rule out that code, in which case the issue is elsewhere.

pdfernhout commented 8 years ago

@eliza411 As another datapoint, I tested the "Preview question form" button on a Chromebook, running Chrome 45.0.2454.98 (64-bit) and the preview page displayed OK, as did two other child pages mentioned below. So, that is a Chrome version with a very similar build number to the one the issue was reported for, as well as one running under a Linux variant (but not exactly Debian), and it worked OK.

BTW, the link you reported is as it should be. The code uses the preview parameter in the URL to know it should use preview mode and not really send survey data to the server. You could also try reloading the page to see what happens; the page still re-appears OK when reloading on the Chromebook.

Is it possible there is some Chrome-specific setting configured for that browser instance or some add-on that might be interfering with opening a child page correctly? It might help in narrowing down the issue if you tried opening other separately launched pages like from the "Sensemaking / Print Story Cards" page or the "Catalysis / Print Catalysis Report page" to see if those child pages open OK. You can try the example project on the NarraFirma website if you don't have a report set up locally yet.

eliza411 commented 8 years ago

I can't reproduce this with Version 49.0.2623.87 (64-bit) so it seems fine to me to close this as "cannot reproduce" or "won't fix".