├── README.md ├── pixiv_link.crx └── pixiv_link ├── background.js ├── favicon-128.png ├── favicon-16.png ├── favicon-19.png ├── favicon-48.png ├── manifest.json └── popup.html /README.md: -------------------------------------------------------------------------------- 1 | # PixivLink 2 | open the pixiv page by id and some other features 3 | - 选中p站id号右键菜单直接转到p站页面 4 | - 选中百度网盘的分享链接的尾部代码右键菜单直接跳转此分享页面 5 | - 选中av/ac号右键菜单直接跳转AB站此内容页面 6 | 7 | ### Usage 8 | 安装: 9 | 下载zip解压,chrome拓展程序中-勾选开发者模式-加载已解压的拓展程序-选择pixiv_link文件夹 10 | 11 | 使用方法: 12 | - pixiv:选中数字(不要包含"id=")-右击-PixivLink-根据id是作者还是图片选择 13 | - 度盘:选中链接最后的内容(不要包含"s/")-右击-PixivLink-其他 14 | - AB站:选中av/ac号(包含av/ac)-右击-PixivLink-其他 15 | 16 | ### Lisence 17 | MIT 18 | -------------------------------------------------------------------------------- /pixiv_link.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliez/PixivLink/6671e8fdb3a1f9ffa5e85eb8e28be08a73c5f747/pixiv_link.crx -------------------------------------------------------------------------------- /pixiv_link/background.js: -------------------------------------------------------------------------------- 1 | (function(info, tab) { 2 | var regexp = { 3 | "BaiduPan": { 4 | reg: /^1[a-z]+/i, 5 | site: "http://pan.baidu.com/s/" 6 | }, 7 | "Bilibili": { 8 | reg: /^av\d+$/i, 9 | site: "http://www.bilibili.com/video/" 10 | }, 11 | "Acfun": { 12 | reg: /^ac\d+$/i, 13 | site: "http://www.acfun.tv/v/" 14 | } 15 | }; 16 | var Pixiv = { 17 | "pic": "http://www.pixiv.net/member_illust.php?mode=medium&illust_id=", 18 | "auth": "http://www.pixiv.net/member.php?id=" 19 | }; 20 | //add an item 21 | // chrome.runtime.onInstalled.addListener(function() { 22 | var id = chrome.contextMenus.create({ 23 | "title": "PixivLink", 24 | "contexts": ["selection"], 25 | "id": "oldDriver" 26 | // "onclick": onClickHandler 27 | }); 28 | console.log("item:" + id); 29 | chrome.contextMenus.create({ 30 | "title": "图片id", 31 | "parentId": "oldDriver", 32 | "contexts": ["selection"], 33 | "id": "picId", 34 | "onclick": function(info, tab) { 35 | var value = info.selectionText.trim(); 36 | window.open(Pixiv["pic"] + value, "_blank"); 37 | } 38 | }); 39 | chrome.contextMenus.create({ 40 | "title": "作者id", 41 | "parentId": "oldDriver", 42 | "contexts": ["selection"], 43 | "id": "authid", 44 | "onclick": function(info, tab) { 45 | var value = info.selectionText.trim(); 46 | window.open(Pixiv["auth"] + value, "_blank"); 47 | } 48 | }); 49 | chrome.contextMenus.create({ 50 | "title": "其他", 51 | "parentId": "oldDriver", 52 | "contexts": ["selection"], 53 | "id": "others", 54 | "onclick": onClickHandler 55 | }); 56 | // }); 57 | 58 | // chrome.contextMenus.onClicked.addListener(onClickHandler); 59 | 60 | function onClickHandler(info, tab) { 61 | var value = info.selectionText.trim(); 62 | console.log(value); 63 | if (value != "") { 64 | for (var i in regexp) { 65 | if (regexp.hasOwnProperty(i)) { 66 | if (regexp[i].reg.test(value)) { 67 | console.log(i); 68 | window.open(regexp[i].site + value, "_blank"); 69 | } 70 | } 71 | } 72 | } 73 | } 74 | })(); 75 | -------------------------------------------------------------------------------- /pixiv_link/favicon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliez/PixivLink/6671e8fdb3a1f9ffa5e85eb8e28be08a73c5f747/pixiv_link/favicon-128.png -------------------------------------------------------------------------------- /pixiv_link/favicon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliez/PixivLink/6671e8fdb3a1f9ffa5e85eb8e28be08a73c5f747/pixiv_link/favicon-16.png -------------------------------------------------------------------------------- /pixiv_link/favicon-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliez/PixivLink/6671e8fdb3a1f9ffa5e85eb8e28be08a73c5f747/pixiv_link/favicon-19.png -------------------------------------------------------------------------------- /pixiv_link/favicon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xliez/PixivLink/6671e8fdb3a1f9ffa5e85eb8e28be08a73c5f747/pixiv_link/favicon-48.png -------------------------------------------------------------------------------- /pixiv_link/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PixivLink", 3 | "manifest_version": 2, 4 | "version": "0.1", 5 | "description": "open the pixiv page by id and some other features", 6 | "browser_action": { 7 | "default_icon": "favicon-19.png", 8 | "default_title": "PixivLink", 9 | "default_popup": "popup.html" 10 | }, 11 | 12 | "permissions": ["contextMenus"], 13 | "background": { 14 | "scripts": ["background.js"] 15 | }, 16 | "icons": { 17 | "16": "favicon-16.png", 18 | "19": "favicon-19.png", 19 | "48": "favicon-48.png", 20 | "128": "favicon-128.png" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pixiv_link/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |

11 | 使用方法: 12 |
pixiv:选中数字(不要包含"id=")-右击-PixivLink-根据id是作者还是图片选择 13 |
度盘:选中链接最后的内容(不要包含"s/")-右击-PixivLink-其他 14 |
AB站:选中av/ac号(包含av/ac)-右击-PixivLink-其他 15 |
Author: 16 | @嘘界Xliez 17 |

18 |
19 | 20 | 21 | 22 | 23 | 24 | 37 | --------------------------------------------------------------------------------