Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fix some PDF handing bugs
Browse files Browse the repository at this point in the history
1. Fix resourceType check for session.webRequest
2. Fix #12385 (due to module path being unresolvable)

Test Plan:
0. Enable payments. Close Brave.
1. npm run add-simulated-payment-history
2. Go to Brave payments, open your contribution history.
3. Click on a PDF file in your contribution history. It should offer to save the file.
  • Loading branch information
diracdeltas committed Dec 27, 2017
1 parent 9bb3c67 commit f0cdf9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'use strict'

const tabs = require('./browser/tabs')
const {fileUrl} = require('../../js/lib/appUrlUtil')
const {fileUrl} = require('../js/lib/appUrlUtil')
const {getWebContents} = require('./browser/webContentsCache')

const renderToPdf = (appState, action) => {
Expand Down
2 changes: 1 addition & 1 deletion app/pdfJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function isPDFDownloadable (details) {
// viewer to open the PDF, but first check whether the Content-Disposition
// header specifies an attachment. This allows sites like Google Drive to
// operate correctly (#6106).
if (details.type === 'main_frame' &&
if (details.resourceType === 'mainFrame' &&
details.url.indexOf('=download') === -1) {
return false
}
Expand Down

0 comments on commit f0cdf9a

Please sign in to comment.