Full Screen

For all website. ctrl + alt + F

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

Advertisement:

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

Advertisement:

// ==UserScript==
// @name         Full Screen
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  For all website. ctrl + alt + F
// @author       Rafif Adli Mulya
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
   'use strict';
   var x=document;
   function fs(m){
      var m = x.documentElement;
      if (!document.fullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement&&!document.msFullscreenElement){
         if(m.requestFullscreen){m.requestFullscreen()}
         else if(m.webkitRequestFullscreen){m.webkitRequestFullscreen()}
         else if(m.msRequestFullscreen){m.msRequestFullscreen()}
         else if(m.mozRequestFullscreen){m.mozRequestFullscreen()}
         else{alert('Full Screen not supported on this Browser')}
      }else{
         if(x.exitFullscreen){x.exitFullscreen()}
         else if(x.webkitExitFullscreen){x.webkitExitFullscreen()}
         else if(x.msExitFullscreen){x.msExitFullscreen()}
         else if(x.mozExitFullscreen){x.mozExitFullscreen()}
         else{alert('not supported! try press "ESC" key')}
      }
   }
   x.onkeyup=(e)=>{if(e.ctrlKey&&e.altKey&&e.which==70){fs()}};
   x.ondblclick=()=>{fs()}
})();