Add bilibiliSimpleNewHomeCompatible option

This commit is contained in:
the1812 2020-05-16 13:47:05 +08:00
parent b13d1f34dc
commit bd153b69b7
14 changed files with 38 additions and 18 deletions

View File

@ -478,6 +478,7 @@ declare global {
restoreFloors: boolean,
quickFavorite: boolean,
quickFavoriteID: number,
bilibiliSimpleNewHomeCompatible: boolean,
latestVersionLink: string,
currentVersion: string,
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@
"custom-control-background.min.js": "B9F366B251D1572ACE801FF6ECF15D4D1AAB3EA5A5B04B961B6F4310E2AB1A84",
"custom-navbar.min.css": "FFA9C1FBF1889F0C7CD73B9C74952D7F3324AFC0F8669EF1E339EBAEF6F37CFD",
"custom-navbar.min.html": "77F05109E85D21240E2936AA3DEEAB8F5A42E20EFB30D42441EF02831535A958",
"custom-navbar.min.js": "8A98BCB1CCBCF996A66CABFC9F56796EF8B1CB7780F86EE1B6B2F55473962F9F",
"custom-navbar.min.js": "9C703E332EB075D72FE0718C8D50B818F90F9144880CEEADC1086E7FCB83A1E0",
"custom-navbar-activities.min.js": "802226FE2C24D56379A6EAD13D3697A4D5A46109D0C63EDACAE8E667ED267EA1",
"custom-navbar-blank.min.js": "DC2B75D5760EECD3A257785FDFBB7E5DEBF61CD9083C68DD5BCE468B093F54F3",
"custom-navbar-category.min.js": "4C9BC4659F7DA0ED97CD7B99175F3D0494C5D575CB14C82776F0C5CB2D31C56A",
@ -54,12 +54,13 @@
"custom-navbar-video-list.min.js": "08D6713144E910C1303CB610A5890A5663B92BE82630BDA3C8E6299FB4A429E2",
"custom-navbar-watchlater-list.min.js": "57EA2C62F7442750BB177B9898CF07BA61C45F0FD99737516ED609051699B054",
"danmaku-converter.min.js": "6C844406F060DCF2483F9CC4C7329911ED77BC77097F2BC5B925B6F12C990820",
"dark.min.css": "1F69003C9D3360C31D74CCAC1FD2601B5756CD7D4CC05FB6CC97D5F280AFE377",
"dark.min.css": "9B13589C9A72DFEEF33E6170F65C8420330D4C53B97D43AC8FE50F304609D390",
"dark.user.css": "7854B0AFA31668D11291DECC820214B53108439286871645852C6D0AE0900316",
"dark-color-scheme.min.js": "6D353AC738180317ACF9D2E046BFFBA0ACC0FA7A8D22B8E16C51127CDE4FE96B",
"dark-important.min.css": "9381B563726BCA701DD77C7AD572793538A45CB839F56008A55EE46821EA1B05",
"dark-navbar.min.css": "7FAD547E326B768904B3739C978DF86FFDDD5E5064FB8F490710D197CCC3018B",
"dark-schedule.min.js": "853C446547603F4F0425F19F09F73335C9EC451A790C1C07E5E5B88A09E9B453",
"dark-slice-9.min.css": "0ECA7B7E317F42005F64EB10C47EA57A092DA3970F6B88439114FBDA2F4F6712",
"dark-styles.min.js": "74E6D655F88E50A27D60F189554F6656CCD2A6EA2686FD9946CA9A89EABF7719",
"debounce.min.js": "54D33E1273C1F3FE19550BF1844339C3D54D6B01DF8A39C3162D95B93B079CFA",
"default-danmaku-settings.min.css": "D9942B184FEDA7B08CFA0C34920E97D7A83B81762DCBF757642EBB60F95FF25D",

Binary file not shown.

File diff suppressed because one or more lines are too long

2
min/dark.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@ export const getScriptBlocker = async () => {
// 开启简化首页和自定义顶栏时, 阻断所有其他的非内联<script>
// 内联<script>含有一些页面初始化信息, 正好可以被利用
if (await GM.getValue('simplifyHome') && await GM.getValue('customNavbar') &&
!(await GM.getValue('bilibiliSimpleNewHomeCompatible')) &&
document.URL.replace(window.location.search, '') === 'https://www.bilibili.com/') {
blockPatterns = [/^[^<]./]
// 加个空函数避免一些图片 onload 里调用 reportfs 报错

View File

@ -229,6 +229,7 @@ export const settings = {
restoreFloors: false,
quickFavorite: false,
quickFavoriteID: 0,
bilibiliSimpleNewHomeCompatible: false,
cache: {},
}
const fixedSettings = {

View File

@ -38,7 +38,10 @@ const darkHandler = (force: boolean) => {
(dq('.custom-navbar-settings') as HTMLElement).classList.toggle('dark', force)
}
export default (() => {
if (isIframe()) {
const url = document.URL.replace(location.search, '')
const isHome = url === 'https://www.bilibili.com/' || url === 'https://www.bilibili.com/index.html'
if (isIframe() || (settings.bilibiliSimpleNewHomeCompatible && isHome)) {
resources.removeStyle('customNavbarStyle')
return
}
loadSettings()

View File

@ -31,7 +31,8 @@
.lang-change .lang-intro,
#gift-package-item-box .panel-wrapper,
.title-renew-panel .actions,
.user-title-using-cntr .panel {
.user-title-using-cntr .panel,
.international-home {
@include background-color("2");
}
.manga-navbar {