Skip to content

Instantly share code, notes, and snippets.

View greatghoul's full-sized avatar
🏠
Working from home

greatghoul greatghoul

🏠
Working from home
View GitHub Profile
@greatghoul
greatghoul / devtool-script.js
Created January 11, 2024 14:07
Batch Unsubscribe Youtube Channels
(function () {
function clickElement(element) {
return new Promise((resolve, reject) => {
const event = new MouseEvent("click", { bubbles: true, cancelable: true });
element.dispatchEvent(event);
setTimeout(() => resolve(element), 500);
});
}
async function start() {
@greatghoul
greatghoul / event.js
Last active March 15, 2024 07:28
Chrome Extension Example - Popup Panel
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.windows.create({
url: "panel.html",
width: 320,
height: 480,
type: 'panel'
});
});
@greatghoul
greatghoul / manifest.json
Last active October 20, 2023 16:48
Chrome Extension Sample - detect if an extension is installed.
{
"name": "Detect if an extension installed",
"description": "Detect if an extension installed",
"version": "0.1",
"manifest_version": 2,
"permissions": [
"management"
],
"browser_action": {
"default_popup": "popup.html"
alert('hello ' + document.location.href);
@greatghoul
greatghoul / content1.js
Last active May 6, 2023 00:32
chrome extension message passing example
chrome.runtime.onMessage.addListener(
function(message, sender, sendResponse) {
console.log(`${message} in content1`)
sendResponse(`${message} from content1`)
// setTimeout(() => {
// sendResponse(`${message} from content1`)
// }, 2000)
//
// return true
}
@greatghoul
greatghoul / README.md
Last active April 30, 2023 12:33
一言 API:随机返回一句话 | 捷径社区

一言:随机返回一句话

GET https://v1.hitokoto.cn/

参数

@greatghoul
greatghoul / main.user.js
Created August 23, 2022 01:25
下载九酷音乐 mp3
// ==UserScript==
// @name 九酷音乐网mp3下载
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.9ku.com/play/*
// @grant GM_addStyle
// ==/UserScript==
@greatghoul
greatghoul / crawler_dm5_com.py
Last active August 26, 2022 17:52
dm5.com 漫画批量下载
#-*- coding: utf-8
"""
requirements:
PyExecJS
requests
"""
import sys, os, re, requests, execjs
def get_page_list(content):
print ' Fetching page list ...'
@greatghoul
greatghoul / main.user.js
Last active July 20, 2022 14:31
HabitRPG - Hide System Messages in Party
// ==UserScript==
// @name HabitRPG - Hide System Messages in Party
// @namespace https://anl.gg/
// @version 0.1.1
// @description Don't show system messages in party by default.
// @author greatghoul
// @match https://habitica.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=habitica.com
// @grant none
// ==/UserScript==