X
點擊此處開啟此網站的行動版。

技術支援討論區

How can I change the default application for a content type?

已張貼

Running a version of Linux, the default application for PDF files is "Use Document Viewer (default)", which appears to be /usr/bin/evince. I'd much prefer to use /usr/bin/okular; how can I change the default. This question is NOT about how to change the function that is automatically applied when I access a link, in this case "Preview in Firefox", but rather to the default application that I can select when I download a file being viewed in Firefox's previewer.

Running a version of Linux, the default application for PDF files is "Use Document Viewer (default)", which appears to be /usr/bin/evince. I'd much prefer to use /usr/bin/okular; how can I change the default. This question is NOT about how to change the function that is automatically applied when I access a link, in this case "Preview in Firefox", but rather to the default application that I can select when I download a file being viewed in Firefox's previewer.

被選擇的解決方法

This is real progress, a solution to the problem as posted. The command: xdg-mime default okularApplication_pdf.desktop application/pdf makes okular the default.

However when I added okular to the choices for applications in:

  • Edit>Preferences>Applications>PDF

the popup box that appears when I click Download on the preview page changed. The pulldown menu that appears next to "Open with" used to have 3 entries:

  1. Document Viewer (default)
  2. Acroread
  3. Other

Now it has only 2:

  1. Okular (Default)
  2. Other

I'd like it to read

  1. Okular (Default)
  2. Acroread
  3. Other

How can I control the entries in this pulldown list?

Also, how can I make the default choice in the popup box be

  • Open With <whatever> , rather than
  • Save File ?
從原來的回覆中察看解決方案 1

額外的系統細節

已安裝的外掛程式

  • This plugin provides integration with Gnome Shell for live extension enabling and disabling. It can be used only by extensions.gnome.org
  • The IcedTea-Web Plugin executes Java applets.
  • Shockwave Flash 11.2 r202
  • DivX Web Player version 1.4.0.233
  • The Videos 3.8.2 plugin handles video and audio streams.
  • This plug-in detects the presence of iTunes when opening iTunes Store URLs in a web page with Firefox.
  • Gecko Media Player 1.0.8Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer

應用程式

  • Firefox 23.0.1
  • 使用者代理:Mozilla/5.0 (X11; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0
  • 技術支援網址:http://support.mozilla.org/1/firefox/23.0.1/Linux/en-US/

擴充套件

  • Troubleshooter 1.1a (troubleshooter@mozilla.org)

JavaScript

  • incrementalGCEnabled: True

圖形

  • adapterDescription: NVIDIA Corporation -- GeForce 8400GS/PCIe/SSE2
  • adapterDeviceID: GeForce 8400GS/PCIe/SSE2
  • adapterDrivers:
  • adapterRAM:
  • adapterVendorID: NVIDIA Corporation
  • driverDate:
  • driverVersion: 3.3.0 NVIDIA 319.32
  • info: {u'AzureCanvasBackend': u'cairo', u'AzureFallbackCanvasBackend': u'none', u'AzureContentBackend': u'none'}
  • numAcceleratedWindows: 0
  • numAcceleratedWindowsMessage: [u'']
  • numTotalWindows: 8
  • webglRenderer: NVIDIA Corporation -- GeForce 8400GS/PCIe/SSE2
  • windowLayerManagerType: Basic

修改過的偏好設定

  • accessibility.typeaheadfind.flashBar: 0
  • browser.cache.disk.capacity: 358400
  • browser.cache.disk.smart_size.first_run: False
  • browser.cache.disk.smart_size.use_old_max: False
  • browser.cache.disk.smart_size_cached_value: 358400
  • browser.link.open_newwindow: 2
  • browser.places.smartBookmarksVersion: 4
  • browser.startup.homepage:
  • browser.startup.homepage_override.buildID: 20130902133717
  • browser.startup.homepage_override.mstone: 23.0.1
  • dom.mozApps.used: True
  • dom.w3c_touch_events.expose: False
  • extensions.lastAppVersion: 23.0.1
  • general.autoScroll: True
  • network.cookie.prefsMigrated: True
  • places.database.lastMaintenance: 1378826895
  • places.history.expiration.transient_current_max_pages: 104858
  • plugin.disable_full_page_plugin_for_types: application/pdf
  • plugin.importedState: True
  • privacy.sanitize.migrateFx3Prefs: True
  • security.warn_viewing_mixed: False
  • storage.vacuum.last.index: 1
  • storage.vacuum.last.places.sqlite: 1376407215

其他

  • User JS: 否
  • 輔助功能: 否
iamjayakumars 489 個解決方法 5951 個答案

Firefox(orange) button > Tools > Options > Application

  • Search for "PDF" > Action "Alway Ask"
Firefox(orange) button > Tools > Options > Application *Search for "PDF" > Action "Alway Ask"

提出問題者

This changes the application that is automatically applied, not the default application.

This changes the application that is automatically applied, not the default application.
cor-el
  • Top 10 Contributor
  • Moderator
17479 個解決方法 157962 個答案

You can set the default application in Nautilus by right-clicking a pdf file and open the Properties and go to the Open with tab.

  • Nautilus: right-click file > Properties > Open with

See also:

  • /usr/share/applications/mimeinfo.cache and defaults.list
  • ~/.local/share/applications/mimeapps.list

If you choose an application via "Use other" and browse to okular (/usr/bin/okular) and set that as the default then it should stay in that list as a choice if you select another application.

You can set the default application in Nautilus by right-clicking a pdf file and open the Properties and go to the Open with tab. * Nautilus: right-click file > Properties > Open with See also: * http://blog.radevic.com/2012/02/how-to-set-default-apps-aka-how-to-use.html * man xdg-mime * xdg-mime query default application/pdf * xdg-mime default okularApplication_pdf.desktop application/pdf * /usr/share/applications/mimeinfo.cache and defaults.list * ~/.local/share/applications/mimeapps.list If you choose an application via "Use other" and browse to okular (/usr/bin/okular) and set that as the default then it should stay in that list as a choice if you select another application.

由 cor-el 於 修改

選擇的解決方法

This is real progress, a solution to the problem as posted. The command: xdg-mime default okularApplication_pdf.desktop application/pdf makes okular the default.

However when I added okular to the choices for applications in:

  • Edit>Preferences>Applications>PDF

the popup box that appears when I click Download on the preview page changed. The pulldown menu that appears next to "Open with" used to have 3 entries:

  1. Document Viewer (default)
  2. Acroread
  3. Other

Now it has only 2:

  1. Okular (Default)
  2. Other

I'd like it to read

  1. Okular (Default)
  2. Acroread
  3. Other

How can I control the entries in this pulldown list?

Also, how can I make the default choice in the popup box be

  • Open With <whatever> , rather than
  • Save File ?
This is real progress, a solution to the problem as posted. The command: xdg-mime default okularApplication_pdf.desktop application/pdf makes okular the default. However when I added okular to the choices for applications in: * Edit>Preferences>Applications>PDF the popup box that appears when I click Download on the preview page changed. The pulldown menu that appears next to "Open with" used to have 3 entries: # Document Viewer (default) # Acroread # Other Now it has only 2: # Okular (Default) # Other I'd like it to read # Okular (Default) # Acroread # Other How can I control the entries in this pulldown list? Also, how can I make the default choice in the popup box be * Open With <whatever> , rather than * Save File ?
cor-el
  • Top 10 Contributor
  • Moderator
17479 個解決方法 157962 個答案

You can (temporarily) set the default to Acroread like I wrote above by using "Use other" and browse to the Acroread program. That should add Acroread to the list of choices when you change the setting to one of the other available choices.

You can (temporarily) set the default to Acroread like I wrote above by using "Use other" and browse to the Acroread program. That should add Acroread to the list of choices when you change the setting to one of the other available choices.

提出問題者

If only...

Maybe I don't understand. Here's what I did:

  • Prime Firefox to show acroread in the pull-down menu:
  1. Open foo.pdf in the Firefox previewer
  2. Click the download icon in the previewer; a pop-up window appears.
  3. Open the pull-down menu in the pop-up window
  4. Choose "Other..."; a file chooser window appears
  5. Choose /usr/bin/acroread in the pull-down window
  6. Select "Open With" in the pop-up window
  7. Click OK
  • Test the result:
  1. Open foo.pdf in the Firefox previewer
  2. Click the download icon in the previewer; a pop-up window appears.
  3. Open the pull-down menu in the pop-up window
  4. I would expect to see "Acroread" in the pull-down window; no such luck.

Thanks much for your assistance.

If only... Maybe I don't understand. Here's what I did: *Prime Firefox to show acroread in the pull-down menu: # Open foo.pdf in the Firefox previewer # Click the download icon in the previewer; a pop-up window appears. # Open the pull-down menu in the pop-up window # Choose "Other..."; a file chooser window appears # Choose /usr/bin/acroread in the pull-down window # Select "Open With" in the pop-up window # Click OK *Test the result: # Open foo.pdf in the Firefox previewer # Click the download icon in the previewer; a pop-up window appears. # Open the pull-down menu in the pop-up window # I would expect to see "Acroread" in the pull-down window; no such luck. Thanks much for your assistance.
cor-el
  • Top 10 Contributor
  • Moderator
17479 個解決方法 157962 個答案

Try to make this change in the PDF setting in Edit > Preferences > Applications

Try to make this change in the PDF setting in Edit > Preferences > Applications

提出問題者

Today I started Firefox and found that things are working as desired. (Because of the restart?) Thanks for your help.

Today I started Firefox and found that things are working as desired. (Because of the restart?) Thanks for your help.