您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
移动端Yandex浏览器看视频全屏时强制为横屏观看(安卓已经过测试运行,ios并未测试)
当前为
// ==UserScript== // @name Yandex视频横屏插件 // @name:en Yandex Video Player Horizontal Screen Plug-in // @description 移动端Yandex浏览器看视频全屏时强制为横屏观看(安卓已经过测试运行,ios并未测试) // @description:en Yandex browser is set to play horizontally when viewing full-screen video. This is for Android, and IOS is not tested. // @version 1.0.0 // @author Xavier // @namespace http://greasyfork.icu/zh-CN/users/128493 // @match *://*/* // @grant none // @run-at document-end // ==/UserScript== (function() { 'use strict'; var oriHway="landscape-primary"; var oriHtemp="",oriHgamma=0,oriHbeta=0; function orientationHandler(event) { oriHgamma=Math.round(event.gamma); oriHbeta=Math.abs(Math.round(event.beta)); if((oriHbeta<45 && Math.abs(oriHgamma)>25) || (oriHbeta>135 && oriHgamma>25)){ oriHtemp=((oriHgamma>25 && oriHbeta<45) || (oriHgamma<-25 && oriHbeta>135)) ? "landscape-secondary" : "landscape-primary"; if(oriHway!=oriHtemp){ oriHway=oriHtemp; screen.orientation.lock(oriHway); } } } document.addEventListener('webkitfullscreenchange', function(){ try{ if(document.webkitFullscreenElement){ screen.orientation.lock(oriHway); window.addEventListener("deviceorientation", orientationHandler, false); }else{ window.removeEventListener("deviceorientation", orientationHandler, false); } } catch (e) { alert(e.message); } },false); })();