瀏覽器插件

出自 Arch Linux 中文维基

基於使用的插件API的不同,有兩種瀏覽器插件的類型,

  • Netscape plugin API (NPAPI): 工作於小部分瀏覽器(FirefoxChromium 不再 支持這些插件).
  • Pepper plugin API (PPAPI): 工作於小部分瀏覽器 (Chromium 不再 支持這些插件).

Flash players[編輯 | 編輯原始碼]

Adobe Flash Player[編輯 | 編輯原始碼]

警告: Adobe Flash Player結束支持於2020.12.31.結果, 這些插件都不再支持於任何瀏覽器。另外,這個項目不再收到任何Bug修復或安全升級。[1]

一個舊的可用版本安裝同flashplayer-standaloneAUR包. 這個包推送於硬EOL中插入在Flash Player前,所以這個可繼續工作。

Gnash[編輯 | 編輯原始碼]

警告: Gnash並未積極維護。[2] 最後的版本發布在2012.

Gnash 是一個Adobe Flash Player的自由替代。它同時可作為一個電腦和嵌入式設備的播放器。同時作為一個瀏覽器插件,它支持SWF格式到版本7(協同一些版本8和9的特性)以及80%的ActionScript2.0。

Gnash 可被安裝gnash-gitAUR包.

Lightspark[編輯 | 編輯原始碼]

Lightspark是另一個提供Adobe Flash 針對新Flash格式自由替代的嘗試。Lightspark可轉而使用Gnash的舊內容,只要提供用戶同時安裝它們,然後享受更廣的適配範圍。另外它一直活躍於開發,它支持一些流行網頁.

Lightspark 可被安裝lightsparkAURlightspark-gitAUR包.

Ruffle[編輯 | 編輯原始碼]

Ruffle是一個用Rust寫成的Flash Player模擬器.它本地運行為一個獨立的程式,同時在所有的現代瀏覽器通過使用WebAssembly運行。項目仍然在活動的開發中,正式的ActionScript1.0/2.0支援已經就位和改善,ActionScript 3.0支援將到來。

Ruffle可被安裝ruffle-gitAURruffle-nightly-binAUR包.

Java (IcedTea)[編輯 | 編輯原始碼]

注意: 所有Java插件都是僅支援NPAPI

啟用Java支援在你的瀏覽器,你有兩個選項:開源的OpenJDK (推薦) 或甲骨文的專有軟體.更詳細的關於為什麼OpenJDK是被推薦的請見[3]

使用OpenJDK,你需要安裝IcedTea瀏覽器插件,icedtea-web提供它。

如果你想要使用甲骨文的JRE,安裝jreAUR包.

多媒體後端[編輯 | 編輯原始碼]

許多瀏覽器使用GStreamer框架來播放HTML5中的多媒體<audio><video>元素。檢查你的瀏覽器包的可選依賴(或web引擎,如 webkit2gtkqt5-webkit)來確定GStreamer是否支援。見GStreamer#Installation予各種插件的描述。

對於你的瀏覽器無法本地適配的媒體格式(如多數瀏覽器不播放.mkv文件),接下來的插件可用:

  • VLC Plugin — NPAPI plugin that uses VLC as backend.
https://code.videolan.org/videolan/npapi-vlc || npapi-vlcAUR

MozPlugger[編輯 | 編輯原始碼]

警告: MozPlugger 不被維護.最後的版本釋放於2014.

MozPlugger是一個可在你瀏覽器展示多種多媒體格式的NPAPI插件。為了實完成這些,他使用許多附加的程式,如MPlayer, xine, Evince, OpenOffice, TiMidity等。

MozPlugger可被安裝於mozpluggerAUR包。

To modify or add applications to be used by MozPlugger just modify the /etc/mozpluggerrc file. For a more complete list of MozPlugger options see mozplugger(7).

PDF查看器[編輯 | 編輯原始碼]

如果你想要使用Evince同Mozplugger,例如,你在需要在/etc/mozpluggerrc中尋找包含pdf的行,並修改GV()後的相似行,如下:

repeat noisy swallow(evince) fill: evince "$file"

(替換 evince 為一些東西,否則它不是你選擇的查看器)。

在Firefox中使用,你需要改變about:config中的兩個值:

  • 改變 pdfjs.disabled的值為true;
  • 改變plugin.disable_full_page_plugin_for_types的值為空.

然後重啟Firefox以使用插件。

Use LibreOffice instead of OpenOffice[編輯 | 編輯原始碼]

例如, MozPlugger默認使用OpenOffive打開doc文件。為了替換為Libreoffice,請見這個OpenOffice部分:

/etc/mozpluggerrc
...
### OpenOffice
define([OO],[swallow(VCLSalFrame) fill: ooffice2.0 -nologo -norestore -view $1 "$file"
    swallow(VCLSalFrame) fill: ooffice -nologo -norestore -view $1 "$file"
    swallow(VCLSalFrame) fill: soffice -nologo $1 "$file"])
...

也要添加LibreOffice在列表的開始:

/etc/mozpluggerrc
...
### LibreOffice/OpenOffice
define([OO],[swallow(VCLSalFrame) fill: libreoffice --nologo --norestore --view $1 "$file"
    swallow(VCLSalFrame) fill: ooffice2.0 -nologo -norestore -view $1 "$file"
    swallow(VCLSalFrame) fill: ooffice -nologo -norestore -view $1 "$file"
    swallow(VCLSalFrame) fill: soffice -nologo $1 "$file"])
...
注意: Be sure to also choose LibreOffice as your preferred application to open doc files.

在Kate打開cpp文件[編輯 | 編輯原始碼]

另一個簡單地例子,如果你用你最喜歡的文本編輯器(例中使用Kate)打開cpp文件來獲得語法高亮,只用添加新的片段到你的mozpluggerrc文件:

/etc/mozpluggerrc
text/x-c++:cpp:C++ Source File
text/x-c++:hpp:C++ Header File
    repeat noisy swallow(kate) fill: kate -b "$file"

使用mpv替代MPlayer[編輯 | 編輯原始碼]

改變默認的MPlayer為mpv播放器——需要改變必要的地方,例如:

/etc/mozpluggerrc
...
### MPlayer

#define(MP_CMD,[mplayer -really-quiet -nojoystick -nofs -zoom -vo xv,x11 -ao esd,alsa,oss,arts,null -osdlevel 0 $1 </dev/null])
define(MP_CMD,[mpv -really-quiet $1 </dev/null])

#define(MP_EMBED,[embed noisy ignore_errors: MP_CMD(-xy $width -wid $window $1)])
define(MP_EMBED,[embed noisy ignore_errors: MP_CMD(--autofit=$width -wid $window $1)])

#define(MP_NOEMBED,[noembed noisy ignore_errors maxaspect swallow(MPlayer): MP_CMD($1)])
define(MP_NOEMBED,[noembed noisy ignore_errors maxaspect swallow(mpv): MP_CMD($1)])

...

#define(MP_AUDIO,[mplayer -quiet -nojoystick $1 </dev/null])
define(MP_AUDIO,[mpv -really-quiet $1 </dev/null])

#define(MP_AUDIO_STREAM,[controls stream noisy ignore_errors: mplayer -quiet -nojoystick $1 "$file" </dev/null])
define(MP_AUDIO_STREAM,[controls stream noisy ignore_errors: mpv -really-quiet $1 "$file" </dev/null])
...