mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Check GM_addValueChangeListener for compatibility
This commit is contained in:
parent
d2e4701d6a
commit
6c0cc6562c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Bilibili Evolved (Preview)
|
// @name Bilibili Evolved (Preview)
|
||||||
// @version 1.5.33
|
// @version 1.5.34
|
||||||
// @description 增强哔哩哔哩Web端体验(预览版分支): 修复界面瑕疵, 删除广告, 使用夜间模式浏览, 下载视频或视频封面, 以及增加对触屏设备的支持等.
|
// @description 增强哔哩哔哩Web端体验(预览版分支): 修复界面瑕疵, 删除广告, 使用夜间模式浏览, 下载视频或视频封面, 以及增加对触屏设备的支持等.
|
||||||
// @author Grant Howard, Coulomb-G
|
// @author Grant Howard, Coulomb-G
|
||||||
// @copyright 2018, Grant Howrad (https://github.com/the1812)
|
// @copyright 2018, Grant Howrad (https://github.com/the1812)
|
||||||
@ -91,6 +91,10 @@
|
|||||||
}
|
}
|
||||||
function onSettingsChange(change)
|
function onSettingsChange(change)
|
||||||
{
|
{
|
||||||
|
if (typeof GM_addValueChangeListener === "undefined")
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (const key in settings)
|
for (const key in settings)
|
||||||
{
|
{
|
||||||
GM_addValueChangeListener(key, change);
|
GM_addValueChangeListener(key, change);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Bilibili Evolved
|
// @name Bilibili Evolved
|
||||||
// @version 1.5.33
|
// @version 1.5.34
|
||||||
// @description 增强哔哩哔哩Web端体验: 修复界面瑕疵, 删除广告, 使用夜间模式浏览, 下载视频或视频封面, 以及增加对触屏设备的支持等.
|
// @description 增强哔哩哔哩Web端体验: 修复界面瑕疵, 删除广告, 使用夜间模式浏览, 下载视频或视频封面, 以及增加对触屏设备的支持等.
|
||||||
// @author Grant Howard, Coulomb-G
|
// @author Grant Howard, Coulomb-G
|
||||||
// @copyright 2018, Grant Howrad (https://github.com/the1812)
|
// @copyright 2018, Grant Howrad (https://github.com/the1812)
|
||||||
@ -91,6 +91,10 @@
|
|||||||
}
|
}
|
||||||
function onSettingsChange(change)
|
function onSettingsChange(change)
|
||||||
{
|
{
|
||||||
|
if (typeof GM_addValueChangeListener === "undefined")
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (const key in settings)
|
for (const key in settings)
|
||||||
{
|
{
|
||||||
GM_addValueChangeListener(key, change);
|
GM_addValueChangeListener(key, change);
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
1.5.33
|
1.5.34
|
||||||
@ -59,10 +59,10 @@
|
|||||||
const playButton = document.querySelector(".bilibili-player-video-btn-start");
|
const playButton = document.querySelector(".bilibili-player-video-btn-start");
|
||||||
const playerArea = document.querySelector(".bilibili-player-area");
|
const playerArea = document.querySelector(".bilibili-player-area");
|
||||||
|
|
||||||
const onclick = () =>
|
const playerButtonClick = () =>
|
||||||
{
|
{
|
||||||
$(".bilibili-player-video-btn-fullscreen").click();
|
$(".bilibili-player-video-btn-fullscreen").click();
|
||||||
playButton.removeEventListener("click", onclick);
|
playButton.removeEventListener("click", playerButtonClick);
|
||||||
if (playerAreaClick.unbind)
|
if (playerAreaClick.unbind)
|
||||||
{
|
{
|
||||||
playerAreaClick.unbind(playerArea);
|
playerAreaClick.unbind(playerArea);
|
||||||
@ -72,12 +72,12 @@
|
|||||||
playerArea.removeEventListener("click", playerAreaClick);
|
playerArea.removeEventListener("click", playerAreaClick);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let playerAreaClick = onclick;
|
let playerAreaClick = playerButtonClick;
|
||||||
|
|
||||||
playButton.addEventListener("click", onclick);
|
playButton.addEventListener("click", playerButtonClick);
|
||||||
if (settings.touchVideoPlayerDoubleTapControl)
|
if (settings.touchVideoPlayerDoubleTapControl)
|
||||||
{
|
{
|
||||||
playerAreaClick = new DoubleClickEvent(onclick);
|
playerAreaClick = new DoubleClickEvent(playerButtonClick);
|
||||||
playerAreaClick.bind(playerArea);
|
playerAreaClick.bind(playerArea);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user