Commit 9854127d authored by Randall Leeds's avatar Randall Leeds

Fix pdf.js on FF

parent 0fd2fcff
......@@ -48,10 +48,6 @@ class Annotator.Guest extends Annotator
formatted.document.title = formatted.document.title.slice()
formatted
onConnect: (source, origin, scope) =>
# Unfortunately, jschannel chokes on chrome-extension: origins
if origin.match /^chrome-extension:\/\//
origin = '*'
@panel = this._setupXDM
window: source
origin: origin
......@@ -76,6 +72,11 @@ class Annotator.Guest extends Annotator
@plugins.Heatmap._update()
_setupXDM: (options) ->
# jschannel chokes FF and Chrome extension origins.
if (options.origin.match /^chrome-extension:\/\//) or
(options.origin.match /^resource:\/\//)
options.origin = '*'
channel = Channel.build options
channel
......
......@@ -102,6 +102,11 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin
# Construct a channel to another frame
_build: (options) ->
# jschannel chokes on FF and Chrome extension origins.
if (options.origin.match /^chrome-extension:\/\//) or
(options.origin.match /^resource:\/\//)
options.origin = '*'
console.log "Bridge plugin connecting to #{options.origin}"
channel = Channel.build(options)
......@@ -236,10 +241,6 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin
method: 'loadAnnotations'
params: (this._format a for t, a of @cache)
# Unfortunately, jschannel chokes on chrome-extension: origins
if options.origin.match /^chrome-extension:\/\//
options.origin = '*'
channel = this._build options
@links.push
......
......@@ -186,6 +186,11 @@ class Hypothesis extends Annotator
_setupXDM: (options) ->
$rootScope = @element.injector().get '$rootScope'
# jschannel chokes FF and Chrome extension origins.
if (options.origin.match /^chrome-extension:\/\//) or
(options.origin.match /^resource:\/\//)
options.origin = '*'
provider = Channel.build options
# Dodge toolbars [DISABLE]
#@provider.getMaxBottom (max) =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment