X
Kliknite sem pre prechod na mobilnú verziu webu.

Fórum podpory

view pdf files (file protocol) in firefox

Pridané

been struggling some time : I want to open a pdf file from *my computer* in firefox : drag and drop produces an address like "file:///C:/path/to/file.pdf" but for clicking enter just pops up the Save dialog and choosing open with firefox just pops the same dialog over and over again

Windows 7 x64, latest FF

been struggling some time : I want to open a pdf file from *my computer* in firefox : drag and drop produces an address like "file:///C:/path/to/file.pdf" but for clicking enter just pops up the Save dialog and choosing open with firefox just pops the same dialog over and over again Windows 7 x64, latest FF

Vybrané riešenie

Reported it here : https://bugzilla.mozilla.org/show_bug.cgi?id=930763

closing this - post your questions/findings in the bug report

Čítať túto odpoveď v kontexte 0

Ďalšie informácie o systéme

Nainštalované zásuvné moduly

  • Shockwave Flash 11.7 r700
  • Adobe PDF Plug-In For Firefox and Netscape 10.1.7
  • Google Update
  • GEPlugin
  • The plugin allows you to have a better experience with Microsoft Lync
  • 5.1.20125.0
  • NVIDIA 3D Vision plugin for Mozilla browsers
  • NVIDIA 3D Vision Streaming plugin for Mozilla browsers
  • IE Tab 2 Plug-in for Mozilla/Firefox
  • Pando Web Plugin
  • The plugin allows you to have a better experience with Microsoft SharePoint
  • Java(TM) Platform SE binary
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • VLC media player Web Plugin 2.0.2
  • NPWLPG
  • Nexon Game Controller
  • Windows Activation Technologies Plugin for Mozilla
  • DLM Netscape Plugin (2.3.10.115)

Aplikácie

  • Identifikácia prehliadača: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0

Viac informácií

iamjayakumars 492 riešení 5972 odpovedí

Firefox Menu > Tools > Options > Applications

  • Search for PDF and change the Action to Preview in Firefox
Firefox Menu > Tools > Options > Applications *Search for '''PDF''' and change the Action to '''Preview in Firefox'''
Chiranjit Biswas 7 riešení 52 odpovedí
https://support.mozilla.org/en-US/kb/view-pdf-files-firefox-without-downloading-them

Autor otázky

It is already so - have you tried it ?

It is already so - have you tried it ?

Užitočné odpovede

did you read the question ? I want to drag and drop or hit Ctrl+O and open a pdf not preview online pdfs - this works. I mentioned the file protocol

did you read the question ? I want to drag and drop or hit Ctrl+O and open a pdf not preview online pdfs - this works. I mentioned the file protocol
cor-el
  • Top 10 Contributor
  • Moderator
17537 riešení 158573 odpovedí

Dragging a PDF file in a Firefox tab works for me on Linux with the built-in PDF Viewer.

What is your setting for handling PDF files?

Are you using the built-in PDF Viewer or the Adobe Reader or or another external program?

If you have disabled the built-in PDF Viewer then you may need to check the value of the plugin.disable_full_page_plugin_for_types pref on the about:config page and remove the application/pdf part if present or reset the pref to the default via the right-click context menu.

Dragging a PDF file in a Firefox tab works for me on Linux with the built-in PDF Viewer. What is your setting for handling PDF files? *Tools > Options > Applications *http://kb.mozillazine.org/File_types_and_download_actions Are you using the built-in PDF Viewer or the Adobe Reader or or another external program? If you have disabled the built-in PDF Viewer then you may need to check the value of the plugin.disable_full_page_plugin_for_types pref on the about:config page and remove the application/pdf part if present or reset the pref to the default via the right-click context menu.

Autor otázky

Thanks

Nope I have not disabled the built in viewer and it works great for online docs (I did say this)

Tools > Options > Applications

Portable Document Format (PDF) ---> preview in browser PDF document ---> always ask (NO OPTION preview in browser, other option is Other... which opens a list of apps)

plugin.disable_full_page_plugin_for_types --> user set > string > application/pdf

I swear I have not set this - was using Sumatra pdf plugin (no adobe)

Reset to default (empty) still DnD pops the save dialog

Thanks Nope I have not disabled the built in viewer and it works great for online docs (I did say this) Tools > Options > Applications Portable Document Format (PDF) ---> preview in browser PDF document ---> always ask (NO OPTION preview in browser, other option is Other... which opens a list of apps) plugin.disable_full_page_plugin_for_types --> user set > string > application/pdf I swear I have not set this - was using Sumatra pdf plugin (no adobe) Reset to default (empty) still DnD pops the save dialog
cor-el
  • Top 10 Contributor
  • Moderator
17537 riešení 158573 odpovedí

So the pdfjs.disabled pref is set to false to enable the built-in PDF Viewer?

Otherwise Firefox will not use the built-in PDF Viewer and if there isn't a plugin to handle PDF as well then you get the dialog to save the file or open in another application. Current Firefox versions have enabled a built-in PDF Viewer that doesn't have all features that other PDF readers like the Adobe Reader have or may not function properly otherwise.

You can change the action for Portable Document Format (PDF) from Preview in Firefox to use another application like the Adobe Reader or set to Always Ask in "Firefox > Options/Preferences > Applications".

You can set the pdfjs.disabled pref to true on the about:config page to disable the build-in PDF viewer.

You can check the value of the plugin.disable_full_page_plugin_for_types pref on the about:config page and remove the application/pdf part if present or reset the pref to the default via the right-click context menu.

See also:

So the pdfjs.disabled pref is set to false to enable the built-in PDF Viewer? Otherwise Firefox will not use the built-in PDF Viewer and if there isn't a plugin to handle PDF as well then you get the dialog to save the file or open in another application. Current Firefox versions have enabled a built-in PDF Viewer that doesn't have all features that other PDF readers like the Adobe Reader have or may not function properly otherwise. You can change the action for Portable Document Format (PDF) from Preview in Firefox to use another application like the Adobe Reader or set to Always Ask in "Firefox > Options/Preferences > Applications". You can set the pdfjs.disabled pref to true on the <b>about:config</b> page to disable the build-in PDF viewer. You can check the value of the plugin.disable_full_page_plugin_for_types pref on the about:config page and remove the application/pdf part if present or reset the pref to the default via the right-click context menu. See also: *https://support.mozilla.org/kb/view-pdf-files-firefox-without-downloading-them

Autor otázky

I am using the pdf viewer to view pdfs online. I can't use it for viewing **offline pdfs**. plugin.disable_full_page_plugin_for_types is now reset --- DnD still doesn't work and now in the Save > Open with it does not offer to open it with FF - so it made things worse

''I am using the pdf viewer to view pdfs online. I can't use it for viewing **offline pdfs**. plugin.disable_full_page_plugin_for_types is now reset --- DnD still doesn't work and now in the Save > Open with it does not offer to open it with FF - so it made things worse''
cor-el
  • Top 10 Contributor
  • Moderator
17537 riešení 158573 odpovedí
Do online PDF files work? *http://plugindoc.mozdev.org/testpages/pdf.html *http://www.adobe.com/accessibility/pdfs/accessing-pdf-sr.pdf ---- You can delete the mimeTypes.rdf file in the Firefox profile folder to reset all file actions. *http://kb.mozillazine.org/mimeTypes.rdf *http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions
jscher2000
  • Top 10 Contributor
8773 riešení 71727 odpovedí

Užitočné odpovede

On Windows 7, I get a similar result:

  • Drag and drop onto a blank tab from a local folder: Open/Save/Cancel dialog
  • File menu > Open > same file: Open/Save/Cancel dialog

Maybe this is a limitation of the PDF viewer, that it can't view local files due to JavaScript permissions? Actually, I get the same behavior with the Adobe Acrobat plugin selected, so it's not just the viewer.

On Windows 7, I get a similar result: * Drag and drop onto a blank tab from a local folder: Open/Save/Cancel dialog * File menu > Open > same file: Open/Save/Cancel dialog Maybe this is a limitation of the PDF viewer, that it can't view local files due to JavaScript permissions? Actually, I get the same behavior with the Adobe Acrobat plugin selected, so it's not just the viewer.
jscher2000
  • Top 10 Contributor
8773 riešení 71727 odpovedí

Let me revise that. In my daily profile which has been migrated from around the days of Firefox 1, I get the Open/Save/Cancel dialog. Even in Firefox's Safe mode.

However, if I launch Firefox in a new profile, drag and drop works just fine. (File>Open also works fine.) There appears to be a setting at work here, but I'm not sure how to track it down.

Let me revise that. In my daily profile which has been migrated from around the days of Firefox 1, I get the Open/Save/Cancel dialog. Even in Firefox's Safe mode. However, if I launch Firefox in a new profile, drag and drop works just fine. (File>Open also works fine.) There appears to be a setting at work here, but I'm not sure how to track it down.

Upravil(a) jscher2000 dňa

jscher2000
  • Top 10 Contributor
8773 riešení 71727 odpovedí

When I copy the mimeTypes.rdf from my daily profile to the new, properly working profile, the PDF handling goes haywire and PDFs open as plain text (i.e., gibberish). I'm not ready to perform the opposite experiment, but I think cor-el's suggestion above (https://support.mozilla.org/en-US/que.../961938#answer-445464) is a logical thing to try.

When I copy the mimeTypes.rdf from my daily profile to the new, properly working profile, the PDF handling goes haywire and PDFs open as plain text (i.e., gibberish). I'm not ready to perform the opposite experiment, but I think cor-el's suggestion above ([https://support.mozilla.org/en-US/questions/961938#answer-445464]) is a logical thing to try.
cor-el
  • Top 10 Contributor
  • Moderator
17537 riešení 158573 odpovedí

Maybe it helps to restore the plugin.disable_full_page_plugin_for_types pref to the value used when the PDF viewer is enabled.

  • plugin.disable_full_page_plugin_for_types -> application/pdf
Maybe it helps to restore the plugin.disable_full_page_plugin_for_types pref to the value used when the PDF viewer is enabled. *plugin.disable_full_page_plugin_for_types -> application/pdf

Autor otázky

@jscher2000 : thanks

As I said plugin.disable_full_page_plugin_for_types was application/pdf but I thought the suggestion was to reset it and I did that and now FF is not in the "open with" lists in pdfs. Anyway it "was" application/pdf and it made no diff. I'd like to have a definite answer to this - probably a bug report as something is at least undocumented here

@jscher2000 : thanks As I said plugin.disable_full_page_plugin_for_types ''was'' application/pdf but I thought the suggestion was to reset it and I did that and now FF is not in the "open with" lists in pdfs. Anyway it "was" application/pdf and it made no diff. I'd like to have a definite answer to this - probably a bug report as something is at least undocumented here
cor-el
  • Top 10 Contributor
  • Moderator
17537 riešení 158573 odpovedí

If plugin.disable_full_page_plugin_for_types includes application/pdf then Firefox won't use a plugin to embed PDF files in browser window (tab).
Firefox uses this to make it possible to use the built-in PDF Viewer instead.
So if this MIME type isn't included then "Portable Document Format (Preview in Firefox)" isn't possible and only an external viewer can be used or you can save the file.
To be able to use the built-in PDF Viewer you need to add application/pdf to the value of the plugin.disable_full_page_plugin_for_types pref.


If plugin.disable_full_page_plugin_for_types includes application/pdf then Firefox won't use a plugin to embed PDF files in browser window (tab).<br /> Firefox uses this to make it possible to use the built-in PDF Viewer instead.<br /> So if this MIME type isn't included then "Portable Document Format (Preview in Firefox)" isn't possible and only an external viewer can be used or you can save the file.<br /> To be able to use the built-in PDF Viewer you need to add application/pdf to the value of the plugin.disable_full_page_plugin_for_types pref. ---- *http://mxr.mozilla.org/mozilla-central/source/browser/extensions/pdfjs/content/PdfJs.jsm

Autor otázky

@corel : have deleted this preference - FF still uses the internal viewer - please try to reproduce @jscher2000 results - there is a bug someplace here - apparently the profile may carry a setting which prevents opening pdfs in browser - while a new profile works fine

@corel : have deleted this preference - FF still uses the internal viewer - please try to reproduce @jscher2000 results - there is a bug someplace here - apparently the profile may carry a setting which prevents opening pdfs in browser - while a new profile works fine

Autor otázky

i would accept as an answer a bug report at bugzilla

i would accept as an answer a bug report at bugzilla
jscher2000
  • Top 10 Contributor
8773 riešení 71727 odpovedí

In my default profile, renaming mimeTypes.rdf to mimeTypes.old and having Firefox regenerate a default file solves the issue. When I compare the files, there are many, many differences. In addition to "application/pdf" type there is the "application/x-pdf" type, and PDF appears as a possible file extension under everything from plain text files to unknown binary files. I don't think there is a simple way to do an elimination test to figure out what is causing Firefox to display the Open/Save/Cancel dialog. I removed the x-pdf stuff and that didn't work. So I removed every strange reference to PDF and then drag-and-drop worked. Not sure how to describe this bug.


Removed the PDF or X-PDF line from these XML elements:

 <RDF:Seq RDF:about="urn:mimetypes:root">
...
   <RDF:li RDF:resource="urn:mimetype:application/x-pdf"/>
...
 </RDF:Seq>
 
 <RDF:Description RDF:about="urn:mimetype:application/x-octet-stream"
                  NC:description="Adobe Acrobat 7.0 Document"
                  NC:value="application/x-octet-stream"
                  NC:editable="true">
   <NC:fileExtensions>pdf</NC:fileExtensions>
   <NC:fileExtensions>htm</NC:fileExtensions>
   <NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-octet-stream"/>
 </RDF:Description>
 <RDF:Description RDF:about="urn:mimetype:application/unknow"
                  NC:description="Adobe Acrobat 7.0 Document"
                  NC:value="application/unknow"
                  NC:editable="true">
   <NC:fileExtensions>pdf</NC:fileExtensions>
   <NC:fileExtensions>htm</NC:fileExtensions>
   <NC:handlerProp RDF:resource="urn:mimetype:handler:application/unknow"/>
 </RDF:Description>
 <RDF:Description RDF:about="urn:mimetype:text/html"
                  NC:description="Adobe Acrobat 7.0 Document"
                  NC:value="text/html"
                  NC:editable="true">
   <NC:fileExtensions>pdf</NC:fileExtensions>
   <NC:fileExtensions>htm</NC:fileExtensions>
   <NC:handlerProp RDF:resource="urn:mimetype:handler:text/html"/>
 </RDF:Description>
 <RDF:Description RDF:about="urn:mimetype:application/"
                  NC:value="application/"
                  NC:editable="true"
                  NC:description="Adobe Acrobat 7.0 Document">
   <NC:fileExtensions>pdf</NC:fileExtensions>
   <NC:fileExtensions>htm</NC:fileExtensions>
   <NC:handlerProp RDF:resource="urn:mimetype:handler:application/"/>
 </RDF:Description>

Removed these elements completely:

 <RDF:Description RDF:about="urn:mimetype:application/x-pdf"
                  NC:fileExtensions="pdf"
                  NC:description="Adobe Acrobat 7.0 Document"
                  NC:value="application/x-pdf"
                  NC:editable="true">
   <NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-pdf"/>
 </RDF:Description>
 <RDF:Description RDF:about="urn:mimetype:handler:application/x-pdf"
                  NC:alwaysAsk="true"
                  NC:saveToDisk="true"
                  NC:useSystemDefault="false">
   <NC:possibleApplication RDF:resource="urn:handler:local:C:\Program Files (x86)\Mozilla Firefox"/>
   <NC:possibleApplication RDF:resource="urn:handler:local:C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe"/>
   <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-pdf"/>
 </RDF:Description>
 <RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-pdf"
                  NC:prettyName="AcroRd32.exe"
                  NC:path="C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" />
 <RDF:Description RDF:about="urn:mimetype:binary/octet-stream"
                  NC:fileExtensions="pdf"
                  NC:description="Adobe Acrobat 7.0 Document"
                  NC:value="binary/octet-stream"
                  NC:editable="true">
   <NC:handlerProp RDF:resource="urn:mimetype:handler:binary/octet-stream"/>
 </RDF:Description>
 <RDF:Description RDF:about="urn:mimetype:application/download"
                  NC:fileExtensions="pdf"
                  NC:description="Adobe Acrobat 7.0 Document"
                  NC:value="application/download"
                  NC:editable="true">
   <NC:handlerProp RDF:resource="urn:mimetype:handler:application/download"/>
 </RDF:Description>
In my default profile, renaming mimeTypes.rdf to mimeTypes.old and having Firefox regenerate a default file solves the issue. When I compare the files, there are many, many differences. In addition to "application/pdf" type there is the "application/x-pdf" type, and PDF appears as a possible file extension under everything from plain text files to unknown binary files. I don't think there is a simple way to do an elimination test to figure out what is causing Firefox to display the Open/Save/Cancel dialog. I removed the x-pdf stuff and that didn't work. So I removed every strange reference to PDF and then drag-and-drop worked. Not sure how to describe this bug. ---- '''Removed the PDF or X-PDF line from these XML elements:''' &lt;RDF:Seq RDF:about="urn:mimetypes:root"> ... &lt;RDF:li RDF:resource="urn:mimetype:application/x-pdf"/> ... &lt;/RDF:Seq> &lt;RDF:Description RDF:about="urn:mimetype:application/x-octet-stream" NC:description="Adobe Acrobat 7.0 Document" NC:value="application/x-octet-stream" NC:editable="true"> &lt;NC:fileExtensions>pdf&lt;/NC:fileExtensions> &lt;NC:fileExtensions>htm&lt;/NC:fileExtensions> &lt;NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-octet-stream"/> &lt;/RDF:Description> &lt;RDF:Description RDF:about="urn:mimetype:application/unknow" NC:description="Adobe Acrobat 7.0 Document" NC:value="application/unknow" NC:editable="true"> &lt;NC:fileExtensions>pdf&lt;/NC:fileExtensions> &lt;NC:fileExtensions>htm&lt;/NC:fileExtensions> &lt;NC:handlerProp RDF:resource="urn:mimetype:handler:application/unknow"/> &lt;/RDF:Description> &lt;RDF:Description RDF:about="urn:mimetype:text/html" NC:description="Adobe Acrobat 7.0 Document" NC:value="text/html" NC:editable="true"> &lt;NC:fileExtensions>pdf&lt;/NC:fileExtensions> &lt;NC:fileExtensions>htm&lt;/NC:fileExtensions> &lt;NC:handlerProp RDF:resource="urn:mimetype:handler:text/html"/> &lt;/RDF:Description> &lt;RDF:Description RDF:about="urn:mimetype:application/" NC:value="application/" NC:editable="true" NC:description="Adobe Acrobat 7.0 Document"> &lt;NC:fileExtensions>pdf&lt;/NC:fileExtensions> &lt;NC:fileExtensions>htm&lt;/NC:fileExtensions> &lt;NC:handlerProp RDF:resource="urn:mimetype:handler:application/"/> &lt;/RDF:Description> '''Removed these elements completely:''' &lt;RDF:Description RDF:about="urn:mimetype:application/x-pdf" NC:fileExtensions="pdf" NC:description="Adobe Acrobat 7.0 Document" NC:value="application/x-pdf" NC:editable="true"> &lt;NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-pdf"/> &lt;/RDF:Description> &lt;RDF:Description RDF:about="urn:mimetype:handler:application/x-pdf" NC:alwaysAsk="true" NC:saveToDisk="true" NC:useSystemDefault="false"> &lt;NC:possibleApplication RDF:resource="urn:handler:local:C:\Program Files (x86)\Mozilla Firefox"/> &lt;NC:possibleApplication RDF:resource="urn:handler:local:C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe"/> &lt;NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-pdf"/> &lt;/RDF:Description> &lt;RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-pdf" NC:prettyName="AcroRd32.exe" NC:path="C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /> &lt;RDF:Description RDF:about="urn:mimetype:binary/octet-stream" NC:fileExtensions="pdf" NC:description="Adobe Acrobat 7.0 Document" NC:value="binary/octet-stream" NC:editable="true"> &lt;NC:handlerProp RDF:resource="urn:mimetype:handler:binary/octet-stream"/> &lt;/RDF:Description> &lt;RDF:Description RDF:about="urn:mimetype:application/download" NC:fileExtensions="pdf" NC:description="Adobe Acrobat 7.0 Document" NC:value="application/download" NC:editable="true"> &lt;NC:handlerProp RDF:resource="urn:mimetype:handler:application/download"/> &lt;/RDF:Description>

Autor otázky

Well thanks :) I am a bit reluctant to delete/rename the file as it may affect other things - I will verify ASAP. Please post your findings at bugzilla - this is clearly not intended behavior - and post back here (you could name the bug like Firefox does not offer the option to preview offline pdf in older profiles and drop them a link to this question). Will be accepting your answer as soon I check it on my home machine - but again thanks indeed for your time and effort :)

Well thanks :) I am a bit reluctant to delete/rename the file as it may affect other things - I will verify ASAP. Please post your findings at bugzilla - this is clearly not intended behavior - and post back here (you could name the bug like ''Firefox does not offer the option to preview offline pdf in older profiles'' and drop them a link to this question). Will be accepting your answer as soon I check it on my home machine - but again thanks indeed for your time and effort :)

Upravil(a) Mr_and_Mrs_D dňa

jscher2000
  • Top 10 Contributor
8773 riešení 71727 odpovedí

You can file the bug if you like. I need to move on to other issues.

You can file the bug if you like. I need to move on to other issues.