Commit 9211fccc authored by Randall Leeds's avatar Randall Leeds

Support basic document info without plugins

parent 5dad441a
......@@ -77,9 +77,15 @@ module.exports = class Guest extends Annotator
if @plugins.PDF?
metadataPromise = Promise.resolve(@plugins.PDF.getMetadata())
uriPromise = Promise.resolve(@plugins.PDF.uri())
if @plugins.Document?
else if @plugins.Document?
uriPromise = Promise.resolve(@plugins.Document.uri())
metadataPromise = Promise.resolve(@plugins.Document.metadata)
else
uriPromise = Promise.resolve(decodeURIComponent(window.location.href))
metadataPromise = Promise.resolve({
title: document.title
link: [{href: decodeURIComponent(window.location.href)}]
})
return metadataPromise.then (metadata) =>
return uriPromise.then (href) =>
......
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