Skip to content

Commit

Permalink
添加新功能
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglianjie91 committed Aug 23, 2024
1 parent b43843b commit ae820e5
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 757 deletions.
13 changes: 11 additions & 2 deletions src/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ export const history = {
// const
},
network() {
// todo
monkeyWindow.middleMan.addHook(
"https://www.zhihu.com/api/v4/answers/*/relationship?desktop=true",
{
async requestHandler({ url }: { url: string }) {
console.log(url);
},
}
);
},
};

Expand All @@ -57,7 +64,9 @@ export function removeSide() {
'[data-za-detail-view-path-module="RightSideBar"]'
);
const content = document.querySelector(".Topstory-mainColumn");
siderbar?.remove();
setTimeout(() => {
siderbar?.remove();
}, 300);
if (content) {
(content as HTMLElement).style.width = "100%";
}
Expand Down
16 changes: 0 additions & 16 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,3 @@ async function init() {
}

init();

if ("serviceWorker" in navigator) {
window.addEventListener("load", function () {
navigator.serviceWorker.register("./worker.js").then(
function (registration) {
console.log(
"ServiceWorker registration successful with scope: ",
registration.scope
);
},
function (err) {
console.log("ServiceWorker registration failed: ", err);
}
);
});
}
Loading

0 comments on commit ae820e5

Please sign in to comment.