您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove fav directly
- // ==UserScript==
- // @name Remove inaccessible fav
- // @namespace http://tampermonkey.net/
- // @version 0.4
- // @license GPL
- // @description Remove fav directly
- // @author You
- // @match https://www.nodeseek.com/space/*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=nodeseek.com
- // @run-at context-menu
- // ==/UserScript==
- (function() {
- 'use strict';
- function prompt_removal(link, e) {
- if(!confirm('Do you want to remove this link?')) {
- // Continue visiting the link (but for what?)
- return;
- }
- //// remove the link {{
- // Sample: "https://www.nodeseek.com/post-16300-1";
- const match = link.href.match(/post-(\d+)-1/);
- const post_id = parseInt( match[1] );
- console.log(post_id); // eg. 16300
- fetch("https://www.nodeseek.com/api/statistics/collection", {
- method: "POST",
- headers:{"Content-Type": "application/json"},
- body: JSON.stringify({
- postId: post_id,
- action: "remove"
- })
- }).then(response => response.json())
- .then(data => console.log(data))
- .catch(error => console.error(error))
- // }}
- e.preventDefault();
- }
- var links = document.querySelectorAll('.discussion-item');
- links.forEach( link => {
- link.addEventListener('click', (e) => prompt_removal(link, e));
- });
- alert('Clicking on links now offers options to remove them.');
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址