Skip to content

Embedded viewer Firefox Strict ETP mode - "Sorry, this browser version is not supported."#213

Open
thisismattmiller wants to merge 2 commits into
hathitrust:mainfrom
thisismattmiller:main
Open

Embedded viewer Firefox Strict ETP mode - "Sorry, this browser version is not supported."#213
thisismattmiller wants to merge 2 commits into
hathitrust:mainfrom
thisismattmiller:main

Conversation

@thisismattmiller
Copy link
Copy Markdown

Hello, I came across this issue while trying to use embedded viewer on a Library of Congress site:

image

It only happens on Firefox browsers internally at LC, because we have Strict ETP security enabled and blocks all cross site cookies. This also prevents any localstorage interaction via embedded iframes, which due to some code in the viewer triggers an error that prevents the viewer payload from being injected and breaks the viewer.

The error flow on babel/pt/web/firebird/pageviewer.xsl:

  1. This code binds all page errors to the fireBird error handler:
window.addEventListener('error', window.firebirdErrorHandler);
  1. This code will cause a pager error to be thrown, using localstorage under Strict ETP in firefox:
let firebird_config = localStorage.getItem('firebird-reader') || '';
  1. The error will trigger the window.firebirdErrorHandler which has this if statement:
(event.filename && event.filename.indexOf('/firebird/dist/' != -1)))

Which has a code typo event.filename.indexOf('/firebird/dist/' != -1) which should be
event.filename.indexOf('/firebird/dist/') != -1

('/firebird/dist/' != -1) will always == true which means event.filename.indexOf('/firebird/dist/' != -1) will == -1 which will cause the if statement to trigger throwing the popup alert and I think also stop execution so this code is never run and the viewer doesn't work.

It works fine on chrome because it does security differently, but does break it on Firefox IF that Strict ETP is enabled. Anyway thought I would suggest a change that should prevent it in this very specific case.

Thanks for all your work,
-Matt Miller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant