Skip to content

Commit

Permalink
version 0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Emano-Waldeck committed Feb 9, 2020
1 parent 9219f26 commit 5d4151e
Show file tree
Hide file tree
Showing 89 changed files with 24,169 additions and 22,129 deletions.
20 changes: 20 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,21 @@ chrome.extension.isAllowedFileSchemeAccess(allow => allow && chrome.webNavigatio
pathSuffix: '.PDF'
}]
}));
// file handling
if (chrome.fileBrowserHandler) {
chrome.fileBrowserHandler.onExecute.addListener((id, details) => {
if (id === 'open-as-pdf') {
const entries = details.entries;
for (const entry of entries) {
chrome.tabs.create({
url: chrome.runtime.getURL(
'/data/pdf.js/web/viewer.html?file=' + encodeURIComponent(entry.toURL())
)
});
}
}
});
}
// Context menu
chrome.contextMenus.create({
type: 'normal',
Expand Down Expand Up @@ -97,6 +112,11 @@ chrome.contextMenus.onClicked.addListener(({menuItemId, linkUrl}, tab) => {
}
});

// browser action
chrome.browserAction.onClicked.addListener(() => chrome.tabs.create({
url: '/data/pdf.js/web/viewer.html?file=/data/viewer/welcome.pdf'
}));

// FAQs & Feedback
{
const {onInstalled, setUninstallURL, getManifest} = chrome.runtime;
Expand Down
2 changes: 1 addition & 1 deletion data/pdf.js/ReadMe
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/mozilla/pdf.js/releases/download/v2.1.266/pdfjs-2.1.266-dist.zip
https://github.com/mozilla/pdf.js/releases/download/v2.2.228/pdfjs-2.2.228-dist.zip
Loading

0 comments on commit 5d4151e

Please sign in to comment.