Sequenceserver not loading in an iframe

Hi all,
I have been looking for simple options to use SequenceServer on a website, but I couldn’t get it to load in an iframe. I tried to boil the problem down to a simple test case and found that there is a HTTP header called X-Frame-Options=SAMEORIGIN being added by the sequenceserver app. I found this suggestion that this header is used by default in Sinatra: http://stackoverflow.com/questions/7840613/how-do-i-get-sinatra-to-refrain-from-adding-the-x-frame-options-header

The code from that stackoverflow link might fix the problem, but another option is to set the document.domain via javascript in the sequenceserver app. I can have a go at testing the code but if anyone else has seen this problem (or if they have not seen it!) let me know.
Thanks
-Colin

PS we recently implemented a configurable document.domain fix in JBrowse, so that’s the only reason I know about these issues now :slight_smile:

Hi Colin,

I don’t remember anyone coming across this problem before - did you get it sorted?
Thanks,
ben

Hi there,

I had a similar problem and I don’t know if this may help you. I needed a fast fix so this is what I did.

I use nginx to proxy_pass the server from the port (domain.com:4567) to the nice url (species.domain.com/blast/). As such, when I blast from species.domain.com/blast/ it didn’t work because the origin and target domains are not the same. I edited the sequenceserver.rb directly to bypass this as this:

get '/' do headers['Access-Control-Allow-Origin'] = 'http://species.subdomain.com/' headers['Access-Control-Request-Method'] = '*' erb :search end

and

post '/' do headers['Access-Control-Allow-Origin'] = 'http://species.domain.com' headers['Access-Control-Request-Method'] = '*' method = params['method'] [...]

Please remember that this editing the app directly is a bad practice and shoudn’t do it. The changes will go away when the app is updated and you may edit something you don’t have to.

Regards,
Gabriel

El dilluns 24 de març de 2014 5:01:07 UTC+1, Ben Woodcroft va escriure:

Excellent.

Since editing the app is a bad practice, I would make such a change in
config.ru. The snippet below should work - I haven't test it.

app.before do
headers[‘Access-Control-Allow-Origin’] = ‘http://species.subdomain.com/
headers[‘Access-Control-Request-Method’] = ‘*’
end

-- Priyam

Hello Gabriel,

Could you please let me know where exactly I need to put the above codes inside sequenceserver.rb ?

Hi there,

You can instead add the following in your SequenceServer config file (~/.sequenceserver.conf)

:frame_options: ‘ALLOW-FROM http://species.example.com’

Priyam