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 ...@@ -48,10 +48,6 @@ class Annotator.Guest extends Annotator
formatted.document.title = formatted.document.title.slice() formatted.document.title = formatted.document.title.slice()
formatted formatted
onConnect: (source, origin, scope) => onConnect: (source, origin, scope) =>
# Unfortunately, jschannel chokes on chrome-extension: origins
if origin.match /^chrome-extension:\/\//
origin = '*'
@panel = this._setupXDM @panel = this._setupXDM
window: source window: source
origin: origin origin: origin
...@@ -76,6 +72,11 @@ class Annotator.Guest extends Annotator ...@@ -76,6 +72,11 @@ class Annotator.Guest extends Annotator
@plugins.Heatmap._update() @plugins.Heatmap._update()
_setupXDM: (options) -> _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 = Channel.build options
channel channel
......
...@@ -102,6 +102,11 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin ...@@ -102,6 +102,11 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin
# Construct a channel to another frame # Construct a channel to another frame
_build: (options) -> _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}" console.log "Bridge plugin connecting to #{options.origin}"
channel = Channel.build(options) channel = Channel.build(options)
...@@ -236,10 +241,6 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin ...@@ -236,10 +241,6 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin
method: 'loadAnnotations' method: 'loadAnnotations'
params: (this._format a for t, a of @cache) 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 channel = this._build options
@links.push @links.push
......
...@@ -186,6 +186,11 @@ class Hypothesis extends Annotator ...@@ -186,6 +186,11 @@ class Hypothesis extends Annotator
_setupXDM: (options) -> _setupXDM: (options) ->
$rootScope = @element.injector().get '$rootScope' $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 provider = Channel.build options
# Dodge toolbars [DISABLE] # Dodge toolbars [DISABLE]
#@provider.getMaxBottom (max) => #@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