Skip to content

Commit

Permalink
Fix PDF viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Exentrich authored and Exentrich committed Feb 26, 2020
1 parent c9eb4c2 commit eb02fa1
Show file tree
Hide file tree
Showing 3 changed files with 374 additions and 364 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Raindrop.io",
"productName": "Raindrop.io",
"version": "5.1.9",
"version": "5.2.0",
"description": "Crossplatform bookmarking app",
"main": "src/index.js",
"repository": {
Expand All @@ -23,18 +23,18 @@
"forge": "./forge.config.js"
},
"dependencies": {
"electron-context-menu": "0.15.x",
"electron-context-menu": "0.16.x",
"electron-is-dev": "1.x",
"electron-squirrel-startup": "1.x",
"electron-window-state": "5.x",
"update-electron-app": "1.5.x"
},
"devDependencies": {
"@electron-forge/cli": "6.0.0-beta.47",
"@electron-forge/maker-dmg": "^6.0.0-beta.47",
"@electron-forge/maker-squirrel": "^6.0.0-beta.47",
"@electron-forge/maker-zip": "6.0.0-beta.47",
"@electron-forge/publisher-github": "^6.0.0-beta.47",
"electron": "7.1.x"
"@electron-forge/cli": "^6.0.0-beta.50",
"@electron-forge/maker-dmg": "^6.0.0-beta.50",
"@electron-forge/maker-squirrel": "^6.0.0-beta.50",
"@electron-forge/maker-zip": "^6.0.0-beta.50",
"@electron-forge/publisher-github": "^6.0.0-beta.50",
"electron": "9.0.0-beta.3"
}
}
9 changes: 0 additions & 9 deletions src/webView.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,4 @@ app.on('web-contents-created', (e, contents) => {
// Disable Node.js integration
webPreferences.nodeIntegration = false
})
})

app.on('session-created', (session) => {
session.on('will-download', (e, item, contents) => {
if (item.getMimeType() == 'application/pdf' && item.getURL().includes('up.raindrop.io')){
e.preventDefault()
contents.executeJavaScript(`document.querySelector('iframe[src="${item.getURL()}"]').setAttribute('src', 'https://up.raindrop.io/pdfjs/web/viewer.html?file=${item.getURL()}')`)
}
})
})
Loading

0 comments on commit eb02fa1

Please sign in to comment.