您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Main links are converted to direct links, and clicking on the URL below the title opens the Pocket reader (if available).
当前为
// ==UserScript== // @name Pocket direct links // @version 1.0.1 // @namespace http://www.agj.cl/ // @description Main links are converted to direct links, and clicking on the URL below the title opens the Pocket reader (if available). // @license Unlicense // @include http*://getpocket.com/a/queue/list/* // @grant none // ==/UserScript== const onLoad = cb => /interactive|complete/.test(document.readyState) ? setTimeout(cb, 0) : document.addEventListener('DOMContentLoaded', cb); const sel = document.querySelector.bind(document); const selAll = document.querySelectorAll.bind(document); const makeEl = (tag, attrs, ...children) => { const el = document.createElement(tag); if (attrs) Object.keys(attrs).forEach(attr => el.setAttribute(attr, attrs[attr])); children.map(obj => typeof obj === 'string' ? document.createTextNode(obj) : obj) .forEach(node => el.appendChild(node)); return el; }; const eq = a => b => b === a; const not = f => (...args) => !f(...args); const has = a => list => list.includes(a); const isIn = list => obj => list.some(a => a === obj); const toggle = a => list => has(a)(list) ? list.filter(not(eq(a))) : list.concat([a]); const tap = f => (...args) => { f(...args); return args[0] }; const log = tap(console.log); onLoad(() => { log('okay'); const fix = () => { log(Array.from(selAll('#queue > .item:not(.dl-fixed)'))) .forEach(fixEl); }; const fixEl = el => { const linkTitle = el.querySelector('a.title'); const linkBelow = el.querySelector('.original_url'); const url = decodeURIComponent(linkBelow.getAttribute('href').replace(/^.+redirect\?url=([^&]*)&.*$/, '$1')); const readerURL = linkTitle.getAttribute('href'); log(url, readerURL) linkTitle.setAttribute('href', url); el.querySelector('.item_link').setAttribute('href', url); linkBelow.setAttribute('href', /^\/a\/read\//.test(readerURL) ? readerURL : url); el.classList.add('dl-fixed'); }; const mutationObserver = new MutationObserver(fix); mutationObserver.observe(sel('#queue'), { childList: true }); fix(); });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址