mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Download button is now hidden for PDFs which are opened from 'file://'
This commit is contained in:
parent
ba0a3aebd0
commit
06b3bb8214
2 changed files with 21 additions and 3 deletions
|
@ -381,6 +381,14 @@ function noContextMenuHandler(evt) {
|
|||
evt.preventDefault();
|
||||
}
|
||||
|
||||
function isFileSchema(url) {
|
||||
let i = 0, ii = url.length;
|
||||
while (i < ii && url[i].trim() === '') {
|
||||
i++;
|
||||
}
|
||||
return url.substr(i, 7).toLowerCase() === 'file://';
|
||||
}
|
||||
|
||||
function isDataSchema(url) {
|
||||
let i = 0, ii = url.length;
|
||||
while (i < ii && url[i].trim() === '') {
|
||||
|
@ -665,6 +673,7 @@ export {
|
|||
SCROLLBAR_PADDING,
|
||||
VERTICAL_PADDING,
|
||||
isValidRotation,
|
||||
isFileSchema,
|
||||
cloneObj,
|
||||
PresentationModeState,
|
||||
RendererType,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue