This commit is contained in:
xing 2020-02-15 23:56:55 +08:00
parent 52f77521c8
commit 816b6f3ea6

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name tieba page // @name tieba page
// @namespace http://tampermonkey.net/ // @namespace http://tampermonkey.net/
// @version 0.50 // @version 0.51
// @author fthvgb1 // @author fthvgb1
// @match https://tieba.baidu.com/* // @match https://tieba.baidu.com/*
// @grant unsafeWindow // @grant unsafeWindow
@ -158,12 +158,25 @@ function f(value) {
} else if (fl === 2) { } else if (fl === 2) {
l.textContent = '沙发'; l.textContent = '沙发';
} else if (fl === 3) { } else if (fl === 3) {
l.textContent = '板'; l.textContent = '';
} }
value.querySelector('.list_item_time').parentNode.appendChild(l); value.querySelector('.list_item_time').parentNode.appendChild(l);
} }
} }
function check() {
let userAgentInfo = navigator.userAgent;
let Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
let flag = 0;
for (let v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > -1) {
flag = 1;
break;
}
}
return flag;
}
function list() { function list() {
[ [
'.frs_daoliu_for_app', '.tl_shadow_for_app_modle', '.frs_daoliu_for_app', '.tl_shadow_for_app_modle',
@ -220,6 +233,8 @@ function detail() {
} }
(function () { (function () {
'use strict';
if (check()) {
let url = location.href; let url = location.href;
if (/\/p\/\d+/.test(url)) { if (/\/p\/\d+/.test(url)) {
@ -228,6 +243,7 @@ function detail() {
if (/f\?kw=.+/.test(url)) { if (/f\?kw=.+/.test(url)) {
list(); list();
} }
}
})(); })();