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:

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.

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?

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 ( to the nice url ( As such, when I blast from 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'] = '' headers['Access-Control-Request-Method'] = '*' erb :search end


post '/' do headers['Access-Control-Allow-Origin'] = '' 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.


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


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

app.before do
headers[‘Access-Control-Allow-Origin’] = ‘
headers[‘Access-Control-Request-Method’] = ‘*’

-- 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’