awilkey / fullscreen-jbrowse

Fullscreen plugin for JBrowse
MIT License
3 stars 1 forks source link

"fullscreen is not supported by your browser" when it is. #1

Closed laceysanderson closed 8 years ago

laceysanderson commented 8 years ago

First off, this is an awesome little plugin and Exactly what I needed! That said I'm having some issues when I try to use it within an iFrame.

When I look at a particular JBrowse instance on it's original page (not in an iFrame), the Fullscreen button shows up and works beautifully! However, when moments later I look at the same JBrowse instance (in an iFrame) on the same browser and the same computer, I get told that fullscreen is not supported for my browser. Obviously it is supported since I just used it but the plugin seems to be having difficulty detecting this.

You can see this in action yourself by comparing the following: Original: http://knowpulse.usask.ca/jbrowse/Zmxdm-Mt4.0/ iFrame: http://knowpulse.usask.ca/portal/jbrowse/Medicago

I'm using Chrome 48.0.2564.103 on Mac OS X 10.10.4 and the most recent version of your plugin (cloned yesterday :-)) I've also confirmed I get the same message on Firefox 44.0

I have cleared the cache to the "beginning of time" so it shouldn't be a JBrowse caching issue, right?

laceysanderson commented 8 years ago

Ahhhh! It looks to be a security thing. I finally found a github project that allows fullscreen for iFrames "without the allow attribute" which implied that there is a security mechanism in the page defining the iFrame that needs to be told it's ok to fullscreen. Then I found the allowfullscreen attribute for iframes as specified here: https://developer.mozilla.org/en/docs/Web/HTML/Element/iframe.

To get this plugin working in an iFrame you need to define the iframe with the allowfullscreen attributes for the various browser specs. For example, <iframe src="http://mysite/jbrowse/" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>