-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
“显示视频投稿时间”失效 #4934
Comments
这个错误信息看起来与显示视频投稿时间无关,你这里是所有功能都能用只有显示视频投稿时间失效吗? |
我这里其它功能都正常,只有这一个功能失效。发现打开显示视频投稿时间后控制台会有一个报错:
如果关闭此功能则不会有这个报错。用鼠标点进去报错的位置,会跳转到这个函数的最后一行: 点击展开8612: (e,t,n)=>{
"use strict";
function o(e, t, n) {
return (t = function(e) {
var t = function(e, t) {
if ("object" != typeof e || null === e)
return e;
var n = e[Symbol.toPrimitive];
if (void 0 !== n) {
var o = n.call(e, t || "default");
if ("object" != typeof o)
return o;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}(e, "string");
return "symbol" == typeof t ? t : String(t)
}(t))in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n,
e
}
n.r(t),
n.d(t, {
DoubleClickEvent: ()=>P,
bwpVideoFilter: ()=>i,
createHook: ()=>A,
createPostHook: ()=>B,
de: ()=>c,
dea: ()=>s,
deai: ()=>l,
delay: ()=>u,
deleteValue: ()=>S,
deleteValues: ()=>z,
des: ()=>d,
disableWindowScroll: ()=>R,
dq: ()=>r,
dqa: ()=>a,
fixed: ()=>E,
formData: ()=>I,
getActiveElement: ()=>O,
getCookieValue: ()=>x,
getCsrf: ()=>C,
getDpiSourceSet: ()=>y,
getNumberValidator: ()=>j,
getRandomId: ()=>q,
getUID: ()=>k,
getVue2Data: ()=>G,
isBwpVideo: ()=>f,
isDataSaveMode: ()=>H,
isEmbeddedPlayer: ()=>g,
isIframe: ()=>F,
isNotHtml: ()=>v,
isTyping: ()=>V,
matchPattern: ()=>p,
matchUrlPattern: ()=>b,
mountVueComponent: ()=>h,
none: ()=>m,
pascalCase: ()=>N,
playerReady: ()=>M,
preventEvent: ()=>D,
raiseEvent: ()=>w,
retrieveImageUrl: ()=>T,
simulateClick: ()=>W,
todo: ()=>Z,
unreachable: ()=>U,
waitForForeground: ()=>L
});
const i = e=>{
const t = {
video: ", bwp-video",
".bilibili-player-video video": ", .bilibili-player-video bwp-video,.bpx-player-video-area bwp-video"
}[e];
return t ? e + t : e
}
, r = (e,t)=>t ? e.querySelector(i(t)) : document.querySelector(i(e))
, a = (e,t)=>t ? Array.from(e.querySelectorAll(i(t))) : Array.from(document.querySelectorAll(i(e)))
, c = (e,t,n,o)=>document.evaluate(e, t, null, n, o)
, s = (e,t,n,o)=>{
const i = c(e, t, n ? XPathResult.ORDERED_NODE_SNAPSHOT_TYPE : XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, o);
return Array.from({
length: i.snapshotLength
}, ((e,t)=>i.snapshotItem(t)))
}
, l = (e,t,n,o)=>{
const i = c(e, t, n ? XPathResult.ORDERED_NODE_ITERATOR_TYPE : XPathResult.UNORDERED_NODE_ITERATOR_TYPE, o);
return {
[Symbol.iterator]: ()=>({
next: ()=>{
let e = null;
do {
return e = i.iterateNext(),
e ? {
done: !1,
value: e
} : {
done: !0
}
} while (e)
}
})
}
}
, d = (e,t,n)=>c(e, t, XPathResult.FIRST_ORDERED_NODE_TYPE, n).singleNodeValue
, m = ()=>{}
, f = async()=>{
const {hasVideo: e} = await Promise.resolve().then(n.bind(n, 3311));
return !!await e() && (// eslint-disable-next-line no-underscore-dangle
unsafeWindow.__ENABLE_WASM_PLAYER__ || Boolean(r("#bilibili-player bwp-video")))
}
, u = function() {
let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
return new Promise((t=>setTimeout((()=>t()), e)))
}
, p = (e,t)=>"string" == typeof t ? e.includes(t) : t.test(e)
, b = e=>p(document.URL.replace(window.location.search, ""), e)
, h = (e,t)=>{
const n = "default"in e ? e.default : e;
return (o = n,
o instanceof Function ? new o : o.functional ? new (Vue.extend(o)) : new Vue(o)).$mount(t);
var o
}
, g = ()=>"player.bilibili.com" === window.location.host || document.URL.startsWith("https://www.bilibili.com/html/player.html")
, F = ()=>document.body && unsafeWindow.parent.window !== unsafeWindow
, v = ()=>"text/html" !== document.contentType
, w = (e,t)=>{
const n = new Event(t);
e.dispatchEvent(n)
}
, y = (e,t,n)=>{
if (!n) {
const t = e.match(/.+\.(.+)$/);
n = t ? t[1] : "jpg"
}
return n.startsWith(".") && (n = n.substring(1)),
[1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4].map((o=>{
if ("object" == typeof t) {
if ("width"in t && "height"in t)
return `${e}@${Math.trunc(t.width * o)}w_${Math.trunc(t.height * o)}h.${n} ${o}x`;
if ("width"in t)
return `${e}@${Math.trunc(t.width * o)}w.${n} ${o}x`;
if ("height"in t)
return `${e}@${Math.trunc(t.height * o)}h.${n} ${o}x`;
throw new Error(`Invalid argument 'baseSize': ${JSON.stringify(t)}`)
}
return `${e}@${Math.trunc(t * o)}w_${Math.trunc(t * o)}h.${n} ${o}x`
}
)).join(",")
}
, x = e=>document.cookie.replace(new RegExp(`(?:(?:^|.*;\\s*)${e}\\s*\\=\\s*([^;]*).*$)|^.*$`), "$1")
, k = ()=>x("DedeUserID")
, C = ()=>x("bili_jct")
, E = function(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
const n = 10 ** t;
let o = (Math.trunc(e * n) / n).toString();
const i = o.indexOf(".");
if (i > -1) {
const e = o.length - i - 1;
e < t && (o += "0".repeat(t - e))
} else
o += `.${"0".repeat(t)}`;
return o
}
, A = (e,t,n)=>{
const o = e[t];
return e[t] = function() {
for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
t[i] = arguments[i];
const r = n(...t);
if (r)
return o?.call(this, ...t)
}
,
()=>e[t] = o
}
, B = (e,t,n)=>{
const o = e[t];
return e[t] = function() {
for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
t[i] = arguments[i];
const r = o?.call(this, ...t);
return n(...t),
r
}
,
()=>e[t] = o
}
, D = (e,t,n)=>{
const o = e=>{
(n?.(e) ?? 1) && e.stopImmediatePropagation()
}
;
return e.addEventListener(t, o, {
capture: !0
}),
()=>{
e.removeEventListener(t, o, {
capture: !0
})
}
}
, I = (e,t)=>{
const {encode: n} = {
encode: !0,
...t
};
return Object.entries(e).map((e=>{
let[t,o] = e;
return n ? `${t}=${encodeURIComponent(o)}` : `${t}=${o}`
}
)).join("&")
}
, S = (e,t)=>{
const n = e.findIndex(t);
return -1 !== n && (e.splice(n, 1),
!0)
}
, z = (e,t)=>{
let n = !1;
do {
n = S(e, t)
} while (n);
return n
}
;
class P {
constructor(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
this.handler = e,
this.preventSingle = t,
o(this, "elements", []),
o(this, "singleClickHandler", m),
o(this, "clickedOnce", !1),
o(this, "stopPropagationHandler", (e=>{
e.stopImmediatePropagation()
}
)),
o(this, "doubleClickHandler", (e=>{
this.clickedOnce ? (this.clickedOnce = !1,
Promise.resolve().then((()=>{
this.handler?.(e)
}
))) : (this.clickedOnce = !0,
setTimeout((()=>{
this.clickedOnce && (this.clickedOnce = !1,
this.preventSingle && this.singleClickHandler?.(e))
}
), 200)),
this.preventSingle && e.stopImmediatePropagation()
}
))
}
bind(e) {
-1 === this.elements.indexOf(e) && (this.elements.push(e),
e.addEventListener("click", this.doubleClickHandler, {
capture: !0
}),
e.addEventListener("dblclick", this.stopPropagationHandler, {
capture: !0
}))
}
unbind(e) {
const t = this.elements.indexOf(e);
-1 !== t && (this.elements.splice(t, 1),
e.removeEventListener("click", this.doubleClickHandler, {
capture: !0
}),
e.removeEventListener("dblclick", this.stopPropagationHandler, {
capture: !0
}))
}
}
const M = async()=>{
const {sq: e} = await Promise.resolve().then(n.bind(n, 3311))
, {logError: t} = await Promise.resolve().then(n.bind(n, 4732));
return await e((()=>unsafeWindow), (()=>void 0 !== unsafeWindow.UserStatus)),
new Promise(((e,n)=>{
"https://www.bilibili.com/blackboard/newplayer.html" === document.URL.replace(window.location.search, "") && document.URL.includes("fjw=true") || g() || (unsafeWindow.onLoginInfoLoaded ? unsafeWindow.onLoginInfoLoaded(e) : (t(new Error("utils.playerReady 失败")),
console.error("typeof onLoginInfoLoaded === " + typeof unsafeWindow.onLoginInfoLoaded),
n()))
}
))
}
, O = ()=>{
let {activeElement: e} = document;
for (; null !== e.shadowRoot; )
e = e.shadowRoot.activeElement;
return e
}
, V = ()=>{
const e = O();
return !!e && (!!e.hasAttribute("contenteditable") || ["input", "textarea"].includes(e.nodeName.toLowerCase()))
}
, T = e=>{
if (!(e instanceof HTMLElement))
return null;
const t = (()=>{
if (e.hasAttribute("data-src"))
return e.getAttribute("data-src");
if (e instanceof HTMLImageElement)
return e.src;
if (e instanceof HTMLPictureElement && r(e, "img")) {
return r(e, "img").src
}
if (r(e, "picture img")) {
return r(e, "picture img").src
}
const {backgroundImage: t} = e.style;
if (!t)
return null;
const n = t.match(/url\("(.+)"\)/);
return n ? n[1] : null
}
)()
, n = t.match(/^(.+)(\..+?)(@.+)$/);
if (n)
return {
url: n[1] + n[2],
extension: n[2]
};
const o = t.match(/^(.+)(\..+?)$/);
return o ? {
url: o[1] + o[2],
extension: o[2]
} : null
}
, L = e=>{
const t = ()=>"visible" === document.visibilityState && (e(),
document.removeEventListener("visibilitychange", t),
!0);
t() || document.addEventListener("visibilitychange", t)
}
, R = async e=>{
// eslint-disable-next-line prefer-arrow-callback
const t = A(unsafeWindow, "scrollTo", (function() {
return !1
}
));
return e ? (await e(),
t(),
m) : t
}
, j = function() {
let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : -1 / 0
, t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 / 0;
return (n,o)=>lodash.isNumber(Number(n)) ? lodash.clamp(n, e, t) : o
}
, N = e=>lodash.upperFirst(lodash.camelCase(e))
, q = function() {
let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 8;
const t = new Uint8Array(Math.ceil(e / 2));
return crypto.getRandomValues(t),
[...t].map((e=>e.toString(16).padStart(2, "0"))).join("").substring(0, e)
}
, Z = function() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
throw new Error(`todo. args: ${JSON.stringify(t)}`)
}
, U = ()=>{
throw new Error("unreachable")
}
, H = ()=>navigator.connection?.saveData ?? !1
, W = (e,t)=>{
const n = new MouseEvent("mousedown",t)
, o = new MouseEvent("mouseup",t)
, i = new PointerEvent("pointerdown",t)
, r = new PointerEvent("pointerup",t)
, a = new MouseEvent("click",t);
e.dispatchEvent(i),
e.dispatchEvent(n),
e.dispatchEvent(r),
e.dispatchEvent(o),
e.dispatchEvent(a)
}
, G = e=>// eslint-disable-next-line no-underscore-dangle
e.__vue__ ?? e.parentElement.__vue__ ?? e.children[0].__vue__ ?? e.__vueParentComponent
} 脚本版本是 |
好的,我知道了,找个时间修复下 |
是的 |
可能相关: #4933 |
奇怪,我没改代码啊,功能居然恢复了,是B站在作妖吧 |
确实,在我发现这个问题的第二天晚上就正常了,不知道是B站在搞什么 |
就此时此刻,在我眼前又失效了,一模一样的状况,低版本的浏览器不行,高版本的可以 |
感觉应该是灰度测试,我这里一切正常,而且最近没空搞,看周末什么情况吧 |
见 #4955, 估计有新一波灰度开过来了 |
真几把闲的蛋疼 |
如何了哥 |
我已经提交了PR(#4960),目前已经合并了,具体什么时候到预览版和正式版我就不清楚了。如果想要立马使用上最新版本可以尝试本地编译。 |
对应功能
@wisokey 之前旧版本都用的好好的,今天发现不行了,然后更新之后就只能在新版本Tampermonkey beta上用了(T▽T)
问题描述
新版浏览器5.0以上的Tampermonkey beta可以正常使用,但是旧版浏览器最高只能装4.20.6187
脚本版本
v2.9.3-46-g9e5159f7d
脚本管理器及版本
Tampermonkey beta v4.20.6187
浏览器及版本
QQ浏览器11.9
播放器版本
4.8.48-86c1d4e8
播放策略
默认
错误信息
附加截图
No response
致遇到了相同问题准备回复的人
太长不看:
1、遇到了相同的问题:请用左下角的 reaction 点赞
2、实时关注该 Issue 的后续进展:请用 Issue 页上的 Subscribe 功能(在 PC 端按钮通常位于页面右侧)。
请您回复前务必确认您有在本 Issue 之外补充了其它相关信息(比如 Log)再行回复以免对他人造成不必要的困扰
完整版
由于每个 Issue 甚至整个项目都是可以订阅通知的, 对于已经有人汇报过的 Bug, 如果您也遇到了并且没有其他信息要补充, 可以直接在左下点个赞表示 +1, 不要再去新增评论。想关注后续的可以用 Subscribe,Subscribe 之后该 Issue 如果有变动都可以收到通知,如果不想被回复打扰可以使用更加进阶的 Customize 功能,勾选 "Closed" & "Reopened"。Closed 通常代表该 Issue 已被解决,极少数情况下的 Reopened 代表该 Issue 的问题重新出现。如果您新增了无意义评论,因为 Issue 这个 bug tracker 与邮件列表类似,订阅某个 Issue 的用户会在每次这个 Issue 有新的动态时收到一封新的提醒邮件。也就是说,在 Issue 中的一个不能提供新的信息的评论,相当于给所有订阅这个 Issue 的用户发了一封垃圾邮件(spam)。尤其项目的维护者也是订阅者中的一员,太多垃圾邮件会对维护者带来很多不必要的困扰。发送垃圾邮件在开源社区通常是不那么受欢迎的行为。The text was updated successfully, but these errors were encountered: