├── .babelrc ├── .gitignore ├── crx ├── .gitignore ├── extension.crx ├── extension │ ├── images │ │ ├── icon_16.png │ │ ├── icon_32.png │ │ ├── icon_96.png │ │ └── icon_128.png │ ├── popup.html │ ├── manifest.json │ ├── background.js │ └── psl.min.js ├── README.md ├── src │ ├── App.vue │ ├── main.js │ ├── components │ │ ├── Info.vue │ │ ├── Support.vue │ │ └── Table.vue │ └── common │ │ └── js │ │ └── tools.js ├── webpack.config.js └── package.json ├── dist ├── ui.html ├── show-site-all-userjs.user.js └── show-site-all-userjs.gf.user.js ├── src ├── ui.html ├── common │ ├── js │ │ ├── locale.js │ │ └── tools.js │ └── lang │ │ ├── zh-tw.js │ │ ├── zh-CN.js │ │ ├── ja.js │ │ ├── en-US.js │ │ ├── tr-TR.js │ │ ├── fr-FR.js │ │ └── ru-RU.js ├── App.vue ├── components │ ├── Indicator.vue │ ├── Info.vue │ ├── Support.vue │ └── Table.vue └── main.js ├── .travis.yml ├── package.json ├── userscript ├── tpl.js └── main.js ├── README-ZH.md ├── README.md └── README-RU.md /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .idea/ 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /crx/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .idea/ 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /crx/extension.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jae-jae/Userscript-Plus/HEAD/crx/extension.crx -------------------------------------------------------------------------------- /crx/extension/images/icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jae-jae/Userscript-Plus/HEAD/crx/extension/images/icon_16.png -------------------------------------------------------------------------------- /crx/extension/images/icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jae-jae/Userscript-Plus/HEAD/crx/extension/images/icon_32.png -------------------------------------------------------------------------------- /crx/extension/images/icon_96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jae-jae/Userscript-Plus/HEAD/crx/extension/images/icon_96.png -------------------------------------------------------------------------------- /crx/extension/images/icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jae-jae/Userscript-Plus/HEAD/crx/extension/images/icon_128.png -------------------------------------------------------------------------------- /crx/README.md: -------------------------------------------------------------------------------- 1 | # Userscript+ Chrome extension 2 | 3 | ![](https://raw.githubusercontent.com/jae-jae/_resources/master/img/175033.png) 4 | 5 | - Install: [https://github.com/jae-jae/Userscript-Plus/raw/master/crx/extension.crx](https://github.com/jae-jae/Userscript-Plus/raw/master/crx/extension.crx) -------------------------------------------------------------------------------- /dist/ui.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Show Site All UserJS 7 | 8 | 9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/ui.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Show Site All UserJS 7 | 8 | 9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /crx/extension/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Show Site All UserJS 7 | 8 | 9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/common/js/locale.js: -------------------------------------------------------------------------------- 1 | const langContext = require.context('../lang/', false, /\.js$/) 2 | 3 | let message = {} 4 | 5 | let getName = (path) => { 6 | let name = path.match(/([^/]+)\.js$/)[1] 7 | return name 8 | } 9 | 10 | langContext.keys().map((lang) => { 11 | let name = getName(lang) 12 | message[name.toLowerCase()] = require('../lang/' + name).default 13 | }) 14 | 15 | export default message 16 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | -------------------------------------------------------------------------------- /crx/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 9 3 | before_script: 4 | - npm install yarn webpack -g 5 | - git checkout master 6 | - cd crx 7 | - yarn 8 | - cd .. 9 | - yarn 10 | 11 | script: 12 | - yarn build 13 | - cd crx 14 | - yarn build 15 | - cd .. 16 | 17 | after_success: 18 | - pwd 19 | - git commit -a -m "Travis build" 20 | - git status 21 | - git push "https://${GH_TOKEN}@${GH_REF}" master:master 22 | 23 | cache: 24 | yarn: true 25 | webpack: true 26 | directories: 27 | - "node_modules" 28 | - "crx/node_modules" 29 | 30 | env: 31 | global: 32 | - GH_REF: github.com/jae-jae/Userscript-Plus.git -------------------------------------------------------------------------------- /src/common/lang/zh-tw.js: -------------------------------------------------------------------------------- 1 | export default { 2 | table: { 3 | tips: '發現{count}個腳本適用於當前頁面', 4 | install: '安裝', 5 | title: '標題', 6 | author: '作者', 7 | authorTips: '點擊訪問{name}主頁', 8 | dailyInstalls: '今日安裝', 9 | updatedTime: '更新時間', 10 | action: '操作', 11 | version: '版本', 12 | score: '評分', 13 | totalInstalls: '總安裝量', 14 | description: '描述', 15 | donate: '打賞', 16 | wechat: '微信', 17 | alipay: '支付寶', 18 | paypal: 'PayPal', 19 | closeDonate: '關閉打賞', 20 | feedback: '反饋', 21 | close: '該網站本次會話的所有頁面都不再顯示', 22 | scriptInstalling: '腳本安裝中...', 23 | search: '搜索' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/common/lang/zh-CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | table: { 3 | tips: '发现{count}个脚本适用于当前页面', 4 | install: '安装', 5 | title: '标题', 6 | author: '作者', 7 | authorTips: '点击访问{name}主页', 8 | dailyInstalls: '今日安装', 9 | updatedTime: '更新时间', 10 | action: '操作', 11 | version: '版本', 12 | score: '评分', 13 | totalInstalls: '总安装量', 14 | description: '描述', 15 | donate: '打赏', 16 | wechat: '微信', 17 | alipay: '支付宝', 18 | paypal: 'PayPal', 19 | closeDonate: '关闭打赏', 20 | feedback: '反馈', 21 | close: '该网站本次会话的所有页面都不再显示', 22 | scriptInstalling: '脚本安装中...', 23 | search: '搜索' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/common/lang/ja.js: -------------------------------------------------------------------------------- 1 | export default { 2 | table: { 3 | tips: 'このページで使用できるスクリプトが {count} 個見つかりました', 4 | install: 'インストール', 5 | title: 'スクリプト名', 6 | author: '作者', 7 | authorTips: 'クリックして {name} のホームページを開く', 8 | dailyInstalls: 'DL数/日', 9 | updatedTime: '最終更新', 10 | action: '操作', 11 | version: 'バージョン', 12 | score: '評価', 13 | totalInstalls: '総DL数', 14 | description: '概要', 15 | donate: '寄付', 16 | wechat: 'Wechat', 17 | alipay: 'Alipay', 18 | paypal: 'PayPal', 19 | closeDonate: '寄付をしない', 20 | feedback: 'フィードバック', 21 | close: '次回から表示しない', 22 | scriptInstalling: 'スクリプトをインストール中...', 23 | search: '検索' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/common/lang/en-US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | table: { 3 | tips: 'Found {count} user scripts for the page', 4 | install: 'Install', 5 | title: 'Title', 6 | author: 'Author', 7 | authorTips: 'Click to access the {name} home page', 8 | dailyInstalls: 'Daily', 9 | updatedTime: 'Updated', 10 | action: 'Action', 11 | version: 'Version', 12 | score: 'Score', 13 | totalInstalls: 'Total Installs', 14 | description: 'Description', 15 | donate: 'Donate', 16 | wechat: 'Wechat', 17 | alipay: 'Alipay', 18 | paypal: 'PayPal', 19 | closeDonate: 'Close Donate', 20 | feedback: 'Feedback', 21 | close: 'No longer show', 22 | scriptInstalling: 'Script installing...', 23 | search: 'Search' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/common/lang/tr-TR.js: -------------------------------------------------------------------------------- 1 | export default { 2 | table: { 3 | tips: 'Bu sayfa için {count} sayıda betik bulundu', 4 | install: 'Yükle', 5 | title: 'Başlık', 6 | author: 'Yazar', 7 | authorTips: '{name} ana sayfasına ulaşmak için tıkla', 8 | dailyInstalls: 'Günlük', 9 | updatedTime: 'Güncellendi', 10 | action: 'İşlem', 11 | version: 'Sürüm', 12 | score: 'Puan', 13 | totalInstalls: 'Toplam Yükleme', 14 | description: 'Açıklama', 15 | donate: 'Bağış', 16 | wechat: 'Wechat', 17 | alipay: 'Alipay', 18 | paypal: 'PayPal', 19 | closeDonate: 'Bağışı Kapat', 20 | feedback: 'Geri Bildirim', 21 | close: 'Tekrar Gösterme', 22 | scriptInstalling: 'Betik yükleniyor...', 23 | search: 'Ara' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/components/Indicator.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /src/common/lang/fr-FR.js: -------------------------------------------------------------------------------- 1 | export default { 2 | table: { 3 | tips: 'A trouve {count} scripts utilisateurs pour cette page', 4 | install: 'Installer', 5 | title: 'Titre', 6 | author: 'Auteur', 7 | authorTips: 'Cliquez pour accéder a la page d’accueil {name}', 8 | dailyInstalls: 'Quotidiennement', 9 | updatedTime: 'Mis à jour', 10 | action: 'Action', 11 | version: 'Version', 12 | score: 'Score', 13 | totalInstalls: 'Installations totales', 14 | description: 'Description', 15 | donate: 'Faire une donation', 16 | wechat: 'Wechat', 17 | alipay: 'Alipay', 18 | paypal: 'PayPal', 19 | closeDonate: 'Annuler la donation', 20 | feedback: 'Avis', 21 | close: 'Ne plus montrer', 22 | scriptInstalling: 'Installation du script…', 23 | search: 'Chercher' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/common/lang/ru-RU.js: -------------------------------------------------------------------------------- 1 | export default { 2 | table: { 3 | tips: 'Найдено {count} пользовательских скриптов для страницы', 4 | install: 'Установить', 5 | title: 'Название', 6 | author: 'Автор', 7 | authorTips: 'Нажмите чтобы перейти на страницу автора {name}', 8 | dailyInstalls: 'Ежедневно', 9 | updatedTime: 'Обновлён', 10 | action: 'Действие', 11 | version: 'Версия', 12 | score: 'Рейтинг', 13 | totalInstalls: 'Всего установок', 14 | description: 'Описание', 15 | donate: 'Пожертвования', 16 | wechat: 'Wechat', 17 | alipay: 'Alipay', 18 | paypal: 'PayPal', 19 | closeDonate: 'Закрыть Пожертвования', 20 | feedback: 'Обратная связь', 21 | close: 'Больше не показывать', 22 | scriptInstalling: 'Скрипт устанавливается...', 23 | search: 'Поиск' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import iView from 'iview' 4 | import 'iview/dist/styles/iview.css' // 使用 CSS 5 | import 'animate.css' 6 | import VueI18n from 'vue-i18n' 7 | import localeMessage from './common/js/locale' 8 | 9 | Vue.locale = (locale) => { 10 | 11 | } 12 | 13 | Vue.use(VueI18n) 14 | 15 | Vue.use(iView) 16 | 17 | let nlang = navigator.language.toLowerCase() 18 | if (nlang === 'zh') { 19 | nlang = 'zh-cn' 20 | } 21 | let lang = localeMessage[nlang] ? nlang : 'en-us' 22 | 23 | const i18n = new VueI18n({ 24 | locale: lang, 25 | messages: localeMessage 26 | }) 27 | 28 | let appEl = window.document.getElementById('app') 29 | 30 | new Vue({ // eslint-disable-line no-new 31 | i18n, 32 | el: appEl, 33 | render: h => h(App) 34 | }) 35 | -------------------------------------------------------------------------------- /crx/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import iView from 'iview' 4 | import 'iview/dist/styles/iview.css' // 使用 CSS 5 | import 'animate.css' 6 | import VueI18n from 'vue-i18n' 7 | import localeMessage from '../../src/common/js/locale' 8 | 9 | Vue.locale = (locale) => { 10 | 11 | } 12 | 13 | Vue.use(VueI18n) 14 | 15 | Vue.use(iView) 16 | 17 | let nlang = navigator.language.toLowerCase() 18 | if (nlang === 'zh') { 19 | nlang = 'zh-cn' 20 | } 21 | let lang = localeMessage[nlang] ? nlang : 'en-us' 22 | 23 | const i18n = new VueI18n({ 24 | locale: lang, 25 | messages: localeMessage 26 | }) 27 | 28 | let appEl = window.document.getElementById('app') 29 | 30 | new Vue({ // eslint-disable-line no-new 31 | i18n, 32 | el: appEl, 33 | render: h => h(App) 34 | }) 35 | -------------------------------------------------------------------------------- /crx/extension/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | 4 | "name": "Userscript+ for Tampermonkey", 5 | "description": "Show current site all UserJS,The easier way to install UserJs for Tampermonkey.", 6 | "version": "1.4.5", 7 | "author": "Jaeger ", 8 | "homepage_url": "https://github.com/jae-jae/Userscript-Plus", 9 | "icons": { 10 | "16": "images/icon_16.png", 11 | "32": "images/icon_32.png", 12 | "96": "images/icon_96.png", 13 | "128": "images/icon_128.png" 14 | }, 15 | 16 | "browser_action": { 17 | "default_icon": { 18 | "16": "images/icon_16.png", 19 | "32": "images/icon_32.png", 20 | "96": "images/icon_96.png", 21 | "128": "images/icon_128.png" 22 | }, 23 | "default_popup": "popup.html" 24 | }, 25 | 26 | "background": { 27 | "scripts": ["psl.min.js","background.js"], 28 | "persistent": false 29 | }, 30 | 31 | "permissions": [ 32 | "tabs", 33 | "*://*/*" 34 | ] 35 | } -------------------------------------------------------------------------------- /src/components/Info.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 33 | -------------------------------------------------------------------------------- /crx/src/components/Info.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 33 | -------------------------------------------------------------------------------- /crx/webpack.config.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var CopyWebpackPlugin = require('copy-webpack-plugin'); 3 | 4 | module.exports = { 5 | entry: { 6 | ui:"./src/main.js" 7 | }, 8 | output: { 9 | path: __dirname + '/extension', 10 | filename: "popup.js" 11 | }, 12 | module: { 13 | rules: [ 14 | { 15 | test: /\.js$/, 16 | exclude: /node_modules/, 17 | loader: "babel-loader" 18 | }, 19 | { 20 | test:/\.vue$/, 21 | loader: "vue-loader" 22 | }, 23 | { 24 | test: /\.css$/, 25 | use: [ 'style-loader', 'css-loader' ] 26 | }, 27 | { 28 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 29 | loader: 'url-loader' 30 | }, 31 | { 32 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 33 | loader: 'url-loader' 34 | } 35 | ] 36 | }, 37 | watchOptions:{ 38 | poll: 1000,//监测修改的时间(ms) 39 | aggregateTimeout: 500, //防止重复按键,500毫米内算按键一次 40 | ignored: /node_modules/,//不监测 41 | }, 42 | plugins: [ 43 | new webpack.optimize.UglifyJsPlugin({ 44 | compress: { 45 | warnings: false 46 | } 47 | }) 48 | ] 49 | } -------------------------------------------------------------------------------- /crx/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "show-site-all-userjs", 3 | "version": "2.0.0", 4 | "description": "Show current site all UserJS,The easier way to install UserJs for Tampermonkey.", 5 | "scripts": { 6 | "build": "webpack", 7 | "watch": "webpack --watch", 8 | "standard": "standard --plugin html 'src/**/*.{js,vue}' --fix" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/jae-jae/Show-Site-All-UserJS.git" 13 | }, 14 | "keywords": [ 15 | "userjs", 16 | "tampermonkey" 17 | ], 18 | "author": "Jaeger ", 19 | "license": "MIT", 20 | "bugs": { 21 | "url": "https://github.com/jae-jae/Show-Site-All-UserJS/issues" 22 | }, 23 | "homepage": "https://github.com/jae-jae/Show-Site-All-UserJS#readme", 24 | "devDependencies": { 25 | "babel-core": "^6.26.0", 26 | "babel-loader": "^7.1.2", 27 | "babel-preset-es2015": "^6.24.1", 28 | "copy-webpack-plugin": "^4.0.1", 29 | "css-loader": "^0.28.7", 30 | "eslint-plugin-html": "^3.2.0", 31 | "standard": "^10.0.3", 32 | "style-loader": "^0.18.2", 33 | "url-loader": "^0.5.9", 34 | "vue-loader": "^13.0.4", 35 | "vue-style-loader": "^3.0.1", 36 | "vue-template-compiler": "^2.4.2", 37 | "webpack": "^3.5.5" 38 | }, 39 | "dependencies": { 40 | "animate.css": "^3.5.2", 41 | "fuzzy.js": "^0.1.0", 42 | "iview": "2.12.0", 43 | "timeago.js": "^3.0.2", 44 | "vue": "^2.4.2", 45 | "vue-i18n": "7.2.0" 46 | }, 47 | "standard": { 48 | "ignore": [ 49 | "user.js" 50 | ] 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/components/Support.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 50 | 51 | 60 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "show-site-all-userjs", 3 | "version": "2.0.0", 4 | "description": "Show current site all UserJS,The easier way to install UserJs for Tampermonkey.", 5 | "scripts": { 6 | "build": "webpack --config=build/webpack.config.js && webpack --config=build/webpack.gf.config.js && node build/userscript.js", 7 | "watch:ui": "webpack --watch --config=build/webpack.config.js", 8 | "standard": "standard --plugin html 'src/**/*.{js,vue}' --fix" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/jae-jae/Show-Site-All-UserJS.git" 13 | }, 14 | "keywords": [ 15 | "userjs", 16 | "tampermonkey" 17 | ], 18 | "author": "Jaeger ", 19 | "license": "MIT", 20 | "bugs": { 21 | "url": "https://github.com/jae-jae/Show-Site-All-UserJS/issues" 22 | }, 23 | "homepage": "https://github.com/jae-jae/Show-Site-All-UserJS#readme", 24 | "devDependencies": { 25 | "babel-core": "^6.26.0", 26 | "babel-loader": "^7.1.2", 27 | "babel-preset-es2015": "^6.24.1", 28 | "copy-webpack-plugin": "^4.0.1", 29 | "css-loader": "^0.28.7", 30 | "eslint-plugin-html": "^3.2.0", 31 | "standard": "^10.0.3", 32 | "style-loader": "^0.18.2", 33 | "url-loader": "^0.5.9", 34 | "vue-loader": "^13.0.4", 35 | "vue-style-loader": "^3.0.1", 36 | "vue-template-compiler": "^2.4.2", 37 | "webpack": "^3.5.5" 38 | }, 39 | "dependencies": { 40 | "animate.css": "^3.5.2", 41 | "fuzzy.js": "^0.1.0", 42 | "iview": "2.12.0", 43 | "psl": "^1.1.31", 44 | "timeago.js": "^3.0.2", 45 | "vue": "^2.4.2", 46 | "vue-i18n": "7.2.0" 47 | }, 48 | "standard": { 49 | "ignore": [ 50 | "user.js" 51 | ] 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /crx/src/components/Support.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 53 | 54 | 63 | -------------------------------------------------------------------------------- /crx/extension/background.js: -------------------------------------------------------------------------------- 1 | 2 | const countApi = 'https://greasyfork.org/scripts/by-site.json' 3 | 4 | function getCurrentTabUrl(callback) { 5 | // Query filter to be passed to chrome.tabs.query - see 6 | // https://developer.chrome.com/extensions/tabs#method-query 7 | var queryInfo = { 8 | active: true, 9 | currentWindow: true 10 | }; 11 | 12 | chrome.tabs.query(queryInfo, (tabs) => { 13 | // chrome.tabs.query invokes the callback with a list of tabs that match the 14 | // query. When the popup is opened, there is certainly a window and at least 15 | // one tab, so we can safely assume that |tabs| is a non-empty array. 16 | // A window can only have one active tab at a time, so the array consists of 17 | // exactly one tab. 18 | var tab = tabs[0]; 19 | 20 | // A tab is a plain object that provides information about the tab. 21 | // See https://developer.chrome.com/extensions/tabs#type-Tab 22 | var url = tab.url; 23 | 24 | // tab.url is only available if the "activeTab" permission is declared. 25 | // If you want to see the URL of other tabs (e.g. after removing active:true 26 | // from |queryInfo|), then the "tabs" permission is required to see their 27 | // "url" properties. 28 | console.assert(typeof url == 'string', 'tab.url should be a string'); 29 | 30 | callback(url); 31 | }); 32 | 33 | // Most methods of the Chrome extension APIs are asynchronous. This means that 34 | // you CANNOT do something like this: 35 | // 36 | // var url; 37 | // chrome.tabs.query(queryInfo, (tabs) => { 38 | // url = tabs[0].url; 39 | // }); 40 | // alert(url); // Shows "undefined", because chrome.tabs.query is async. 41 | } 42 | 43 | function getUrlHost(url) { 44 | let a = document.createElement('a'); 45 | a.href = url; 46 | let mainHost = psl.get(a.hostname) || a.hostname.split('.').splice(-2).join('.') 47 | return mainHost 48 | } 49 | 50 | function changeBadge(data) { 51 | getCurrentTabUrl(function(url){ 52 | let host = getUrlHost(url) 53 | let count = data[host] 54 | count = count > 50 ? 50 : count 55 | sessionStorage.setItem('host',host) 56 | if(count) { 57 | chrome.browserAction.setBadgeText({ 58 | text: count.toString() 59 | }) 60 | }else { 61 | chrome.browserAction.setBadgeText({ 62 | text: '' 63 | }) 64 | } 65 | }) 66 | } 67 | 68 | fetch(countApi).then((r) => { 69 | r.json().then((data) => { 70 | console.log('count data loaded!') 71 | chrome.tabs.onUpdated.addListener(() => { 72 | changeBadge(data) 73 | }) 74 | chrome.tabs.onActivated.addListener(() => { 75 | changeBadge(data) 76 | }) 77 | }) 78 | }) -------------------------------------------------------------------------------- /userscript/tpl.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Userscript+ : Show Site All UserJS 3 | // @name:zh Userscript+ : 显示当前网站所有可用的UserJS脚本 Jaeger 4 | // @name:zh-CN Userscript+ : 显示当前网站所有可用的UserJS脚本 Jaeger 5 | // @name:zh-TW Userscript+ : 顯示當前網站所有可用的UserJS腳本 Jaeger 6 | // @name:ja Userscript +:現在のサイトの利用可能なすべてのUserJSスクリプトを表示するJaeger 7 | // @name:ru-RU Userscript+ : Показать пользовательские скрипты (UserJS) для сайта. Jaeger 8 | // @name:ru Userscript+ : Показать пользовательские скрипты (UserJS) для сайта. Jaeger 9 | // @namespace https://github.com/jae-jae/Userscript-Plus 10 | // @version 2.4.0 11 | // @description Show current site all UserJS,The easier way to install UserJs for Tampermonkey. 12 | // @description:zh 显示当前网站的所有可用UserJS(Tampermonkey)脚本,交流QQ群:104267383 13 | // @description:zh-CN 显示当前网站的所有可用UserJS(Tampermonkey)脚本,交流QQ群:104267383 14 | // @description:zh-TW 顯示當前網站的所有可用UserJS(Tampermonkey)腳本,交流QQ群:104267383 15 | // @description:ja 現在のサイトで利用可能なすべてのUserJS(Tampermonkey)スクリプトを表示します。 16 | // @description:ru-RU Показывает пользовательские скрипты (UserJS) для сайта. Легкий способ установить пользовательские скрипты для Tampermonkey. 17 | // @description:ru Показывает пользовательские скрипты (UserJS) для сайта. Легкий способ установить пользовательские скрипты для Tampermonkey. 18 | // @author Jaeger 19 | // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII= 20 | // @include * 21 | {ljs} 22 | // @resource ui https://cdn.jsdelivr.net/gh/jae-jae/Userscript-Plus/dist/ui.html?_={time} 23 | // @resource count https://greasyfork.org/scripts/by-site.json 24 | // @grant GM_xmlhttpRequest 25 | // @grant GM_getResourceText 26 | // @grant GM_getValue 27 | // @grant GM_setValue 28 | // @grant unsafeWindow 29 | // @noframes 30 | // @connect cdn.bootcss.com 31 | // @connect raw.githubusercontent.com 32 | // @connect gist.githubusercontent.com 33 | // @connect cdnjs.cloudflare.com 34 | // @connect greasyfork.org 35 | // @connect cdn.jsdelivr.net 36 | // @run-at document-end 37 | // ==/UserScript== 38 | 39 | unsafeWindow.GmAjax = GM_xmlhttpRequest; 40 | 41 | (function() { 42 | 43 | {code} 44 | 45 | })(); 46 | -------------------------------------------------------------------------------- /src/common/js/tools.js: -------------------------------------------------------------------------------- 1 | /* global parent, Event, sessionStorage */ 2 | 3 | import timeago from 'timeago.js' 4 | import fuzzy from 'fuzzy.js' 5 | import psl from 'psl' 6 | 7 | let config = { 8 | cacheKey: 'jae_fetch_userjs_cache', 9 | countKey: 'jae_fetch_userjs_count', 10 | host: psl.get(window.location.hostname) || window.location.hostname.split('.').splice(-2).join('.'), 11 | api: 'https://greasyfork.org/en/scripts/by-site/{host}.json' 12 | } 13 | 14 | export default { 15 | timeagoFormat (time) { 16 | let lang = (navigator.language === 'zh-CN') ? 'zh_CN' : 'en_short' 17 | return timeago(null, lang).format(time) 18 | }, 19 | installUserJs (uri) { 20 | let evt = parent.document.createEvent('MouseEvents') 21 | evt.initEvent('click', true, true) 22 | let link = parent.document.createElement('a') 23 | link.href = uri 24 | // link.click() 25 | link.dispatchEvent(evt) 26 | }, 27 | dispatchEvent (eventName) { 28 | parent.document.getElementById('jae_userscript_box').dispatchEvent(new Event(eventName)) 29 | }, 30 | /* Nano Templates - https://github.com/trix/nano */ 31 | nano (template, data) { 32 | return template.replace(/\{([\w.]*)\}/g, function (str, key) { 33 | let keys = key.split('.') 34 | let v = data[keys.shift()] 35 | for (let i = 0, l = keys.length; i < l; i++) v = v[keys[i]] 36 | return (typeof v !== 'undefined' && v !== null) ? v : '' 37 | }) 38 | }, 39 | getJSON (url, callback) { 40 | parent.window.GmAjax({ 41 | method: 'GET', 42 | url: url, 43 | onload: (res) => { 44 | let json = JSON.parse(res.responseText) 45 | callback(json) 46 | } 47 | }) 48 | }, 49 | // 获取油猴缓存好的脚本数据 50 | getData (callback) { 51 | let data = sessionStorage.getItem(config.cacheKey) 52 | if (data) { 53 | data = JSON.parse(data) 54 | callback(data) 55 | } else { 56 | let api = this.nano(config.api, { 57 | host: config.host 58 | }) 59 | this.getJSON(api, (json) => { 60 | json = json.map((item) => { 61 | item.user = item.users[0] 62 | return item 63 | }) 64 | sessionStorage.setItem(config.cacheKey, JSON.stringify(json)) 65 | callback(json) 66 | }) 67 | } 68 | }, 69 | 70 | getCount () { 71 | let count = sessionStorage.getItem(config.countKey) 72 | return count >= 50 ? 50 : count 73 | }, 74 | 75 | searcher (data, query) { 76 | let rt = [] 77 | for (let i = 0; i < data.length; i++) { 78 | let item = data[i] 79 | let max = null 80 | let frt = null 81 | for (let key of ['name', 'description', 'user']) { 82 | if (key === 'user') { 83 | frt = fuzzy(item['user']['name'], query) 84 | } else { 85 | frt = fuzzy(item[key], query) 86 | } 87 | if (max === null) { 88 | max = frt 89 | } else if (max.score < frt.score) { 90 | max = frt 91 | } 92 | } 93 | rt.push({ 94 | item, 95 | 'score': max.score 96 | }) 97 | } 98 | rt = rt.filter((a) => a.score !== 0).sort((a, b) => b.score - a.score).map((a) => a.item) 99 | return rt 100 | }, 101 | 102 | isZH () { 103 | let nlang = navigator.language.toLowerCase() 104 | if (nlang === 'zh') { 105 | nlang = 'zh-cn' 106 | } 107 | return nlang.search('zh-') === 0 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /README-ZH.md: -------------------------------------------------------------------------------- 1 | ![userscript+cn.gif](https://cdn.rawgit.com/jae-jae/_resources/master/img/userscript+cn.gif) 2 | # Userscript+ 3 | 4 | [![Build Status](https://travis-ci.org/jae-jae/Userscript-Plus.svg?branch=master)](https://travis-ci.org/jae-jae/Userscript-Plus) 5 | [![Tampermonkey](https://img.shields.io/badge/Tampermonkey-up%20to%20date-green.svg)](https://tampermonkey.net/) 6 | [![webpack](https://img.shields.io/badge/webpack-3.x-orange.svg)](https://github.com/webpack/webpack) 7 | [![Vue](https://img.shields.io/badge/Vue-2.4%2B-yellow.svg)](https://vuejs.org/) 8 | [![iView](https://img.shields.io/badge/iView-2.2.0-brightgreen.svg)](https://www.iviewui.com) 9 | [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) 10 | [![i18n](https://img.shields.io/badge/i18n-PR-blue.svg)](https://github.com/jae-jae/Userscript-Plus/tree/master/src/common/lang) 11 | [![GitHub stars](https://img.shields.io/github/stars/badges/shields.svg?style=social&label=Star&style=flat-square)](https://github.com/jae-jae/Userscript-Plus) 12 | 13 | > 显示当前网站所有的UserJS,一种更容易安装UserJS的方式对于Tampermonkey 14 | 15 | **Userscript+** 是一款`Tampermonkey`脚本,作用是当你浏览网页的时候,从右下角自动为你推荐适用于当前页面的`Tampermonkey`脚本,并且可以一键安装指定的脚本。 16 | 17 | 很多时候,我们并不知道一些网站是否有用户提供用来优化页面的脚本,而**Userscript+** 就能帮你自动寻找适用的UserJS,并默认按照评分高低排序推荐给你,给你带来一种全新的`Tampermonkey`使用体验! 18 | 19 | > 旧版本,V1.x:[https://gist.github.com/jae-jae/39d526079cb2408389129caf98debc29](https://gist.github.com/jae-jae/39d526079cb2408389129caf98debc29) 20 | 21 | ## 安装 22 | 1. 安装Chrome/Firefox插件`Tampermonkey` 23 | 24 | Chrome Store: [https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo]( https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) 25 | 26 | Firefox addons:[https://addons.mozilla.org/en-US/firefox/addon/tampermonkey](https://addons.mozilla.org/en-US/firefox/addon/tampermonkey) 27 | 28 | 2. 安装`Userscript+` 29 | 30 | 你可以通过`GreasyFork`或者`GitHub`来安装此脚本: 31 | - GreasyFork: [https://greasyfork.org/zh-CN/scripts/24508](https://greasyfork.org/zh-CN/scripts/24508-userscript-show-site-all-userjs) 32 | - GitHub: [https://github.com/jae-jae/Userscript-Plus/raw/master/dist/show-site-all-userjs.user.js](https://github.com/jae-jae/Userscript-Plus/raw/master/dist/show-site-all-userjs.user.js) 33 | 34 | ### Userscript+ Chrome/Firefox插件 35 | ![](https://raw.githubusercontent.com/jae-jae/_resources/master/img/175033.png) 36 | 独立的Chrome/Firefox插件版本,更加方便好用: 37 | - Chrome webstore:[https://chrome.google.com/webstore/detail/okiocdganiomklllkfkmhneoibegifch](https://chrome.google.com/webstore/detail/okiocdganiomklllkfkmhneoibegifch) 38 | 39 | - Github: [https://github.com/jae-jae/Userscript-Plus/raw/master/crx/extension.crx](https://github.com/jae-jae/Userscript-Plus/raw/master/crx/extension.crx) 40 | 41 | - Firefox Add-ons: [https://addons.mozilla.org/zh-CN/firefox/addon/userscript-for-tampermonkey](https://addons.mozilla.org/zh-CN/firefox/addon/userscript-for-tampermonkey) 42 | 43 | ## 特性 44 | - 自动在右下角静默为你推荐脚本,并会在10秒后自动消失 45 | - 筛选评分最高的前50条脚本 46 | - 脚本列表支持搜索过滤 47 | - 脚本列表支持自定义排序 48 | - 支持一键安装脚本 49 | - 支持查看脚本详情 50 | - 支持访问脚本首页和作者首页 51 | - 点击关闭按钮后,当前网站的`本次会话`的所有页面都将不会再出现本插件的提示框 52 | - 只有当找到了适用于当前网站的脚本的时候才会显示提示框 53 | - i18n国际化多语言支持。(**[欢迎PR补充语言库!](https://github.com/jae-jae/Userscript-Plus/tree/master/src/common/lang)**) 54 | - Vue+iView界面设计流畅漂亮 55 | 56 | ## 白名单和黑名单 57 | > 脚本编辑界面 => 设置选项卡 => 包含/排除 58 | 59 | 在`Tampermonkey`中进入到本脚本编辑界面,选择`设置`选项卡,这个选项卡下面有`包含/排除`选项,在这里设置白名单和黑名单,看图: 60 | 61 | ![userscript+cn+hei2.gif](https://cdn.rawgit.com/jae-jae/_resources/master/img/userscript+cn+hei2.gif) 62 | 63 | ## 已知Bug 64 | 65 | 1. 在某些网站下面插件界面图标不显示,如:Github 66 | 67 | **原因**:这是因为这些网站的安全策略阻止了插件图标字体文件的加载,导致图标无法正常显示 68 | 69 | ## 贡献代码 70 | 71 | 如果你愿意为本项目贡献代码,请遵守[standard](https://standardjs.com/)规范。 72 | 73 | ## License 74 | MIT 75 | 76 | 77 | -------------------------------------------------------------------------------- /crx/src/common/js/tools.js: -------------------------------------------------------------------------------- 1 | /* global chrome, psl, fetch */ 2 | 3 | import timeago from 'timeago.js' 4 | import fuzzy from 'fuzzy.js' 5 | 6 | let config = { 7 | api: 'https://greasyfork.org/en/scripts/by-site/{host}.json' 8 | } 9 | 10 | export default { 11 | timeagoFormat (time) { 12 | let lang = (navigator.language === 'zh-CN') ? 'zh_CN' : 'en_short' 13 | return timeago(null, lang).format(time) 14 | }, 15 | installUserJs (uri) { 16 | let jsStr = ` 17 | var evt = document.createEvent('MouseEvents'); 18 | evt.initEvent('click', true, true); 19 | var link = document.createElement('a'); 20 | link.href = '${uri}'; 21 | link.dispatchEvent(evt); 22 | ` 23 | chrome.tabs.executeScript(null, {code: jsStr}) 24 | }, 25 | /* Nano Templates - https://github.com/trix/nano */ 26 | nano (template, data) { 27 | return template.replace(/\{([\w.]*)\}/g, function (str, key) { 28 | let keys = key.split('.') 29 | let v = data[keys.shift()] 30 | for (let i = 0, l = keys.length; i < l; i++) v = v[keys[i]] 31 | return (typeof v !== 'undefined' && v !== null) ? v : '' 32 | }) 33 | }, 34 | 35 | get currentTab () { 36 | return new Promise(function (resolve, reject) { 37 | let queryInfo = { 38 | active: true, 39 | currentWindow: true 40 | } 41 | 42 | chrome.tabs.query(queryInfo, (tabs) => { 43 | let tab = tabs[0] 44 | resolve(tab) 45 | }) 46 | }) 47 | }, 48 | 49 | get sessionStorage () { 50 | return new Promise(function (resolve, reject) { 51 | chrome.runtime.getBackgroundPage(function (bg) { 52 | resolve(bg.sessionStorage) 53 | }) 54 | }) 55 | }, 56 | 57 | get host () { 58 | return new Promise((resolve, reject) => { 59 | this.currentTab.then((tab) => { 60 | let a = document.createElement('a') 61 | a.href = tab.url 62 | let mainHost = psl.get(a.hostname) || a.hostname.split('.').splice(-2).join('.') 63 | resolve(mainHost) 64 | }) 65 | }) 66 | }, 67 | 68 | // 获取油猴缓存好的脚本数据 69 | getData (callback) { 70 | this.sessionStorage.then((bgSessionStorage) => { 71 | this.host.then((host) => { 72 | let data = bgSessionStorage.getItem(host) 73 | if (data) { 74 | data = JSON.parse(data) 75 | callback(data) 76 | } else { 77 | let api = this.nano(config.api, { 78 | host: host 79 | }) 80 | fetch(api) 81 | .then((r) => { 82 | r.json().then((json) => { 83 | json = json.map((item) => { 84 | item.user = item.users[0] 85 | return item 86 | }) 87 | bgSessionStorage.setItem(host, JSON.stringify(json)) 88 | callback(json) 89 | }) 90 | }) 91 | } 92 | }) 93 | }) 94 | }, 95 | 96 | searcher (data, query) { 97 | let rt = [] 98 | for (let i = 0; i < data.length; i++) { 99 | let item = data[i] 100 | let max = null 101 | let frt = null 102 | for (let key of ['name', 'description', 'user']) { 103 | if (key === 'user') { 104 | frt = fuzzy(item['user']['name'], query) 105 | } else { 106 | frt = fuzzy(item[key], query) 107 | } 108 | if (max === null) { 109 | max = frt 110 | } else if (max.score < frt.score) { 111 | max = frt 112 | } 113 | } 114 | rt.push({ 115 | item, 116 | 'score': max.score 117 | }) 118 | } 119 | rt = rt.filter((a) => a.score !== 0).sort((a, b) => b.score - a.score).map((a) => a.item) 120 | return rt 121 | }, 122 | 123 | isZH () { 124 | let nlang = navigator.language.toLowerCase() 125 | if (nlang === 'zh') { 126 | nlang = 'zh-cn' 127 | } 128 | return nlang.search('zh-') === 0 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /userscript/main.js: -------------------------------------------------------------------------------- 1 | class FetchUserjs { 2 | constructor() { 3 | this.host = this.getMainHost(); 4 | this.showTime = 10; 5 | this.quietKey = 'jae_fetch_userjs_quiet'; 6 | this.countKey = 'jae_fetch_userjs_count'; 7 | this.tplBox = '
'; 8 | } 9 | 10 | getMainHost () { 11 | let host = window.location.hostname 12 | return psl.get(host) || host.split('.').splice(-2).join('.') 13 | } 14 | 15 | getCountData(host) { 16 | let countData = GM_getResourceText('count') 17 | countData = JSON.parse(countData) 18 | let count = countData[host] 19 | sessionStorage.setItem(this.countKey, count) 20 | return count 21 | } 22 | 23 | setSize(w, h) { 24 | $('.jae-userscript').css({ 25 | width: w, 26 | height: h 27 | }) 28 | } 29 | 30 | addEventListener(eventName, handler) { 31 | document.getElementById('jae_userscript_box').addEventListener(eventName, handler) 32 | } 33 | 34 | bindEvent() { 35 | this.timeId = setTimeout(() => { 36 | $('#jae_userscript_box').remove(); 37 | }, this.showTime * 1000); 38 | 39 | this.addEventListener('max', () => { 40 | this.setSize(860, 492) 41 | $('.jae-userscript').addClass('jae-userscript-shadow') 42 | clearTimeout(this.timeId); 43 | }) 44 | 45 | this.addEventListener('min', () => { 46 | setTimeout(() => { 47 | $('.jae-userscript').removeClass('jae-userscript-shadow') 48 | this.setSize(370, 56) 49 | }, 500) 50 | }) 51 | 52 | this.addEventListener('close', () => { 53 | sessionStorage.setItem(this.quietKey, 1); 54 | $('#jae_userscript_box').remove(); 55 | }) 56 | 57 | this.addEventListener('loading',() => { 58 | clearTimeout(this.timeId); 59 | }) 60 | } 61 | 62 | execFrameJs(frameWindow) { 63 | let uiJs = GM_getResourceText('uiJs'); 64 | return function(jsStr) { 65 | frameWindow.eval(jsStr); 66 | }.call(frameWindow, uiJs); 67 | } 68 | 69 | get isQuiet() { 70 | let quiet = sessionStorage.getItem(this.quietKey); 71 | return quiet ? true : false; 72 | } 73 | 74 | render() { 75 | if (!this.isQuiet) { 76 | let count = this.getCountData(this.host) 77 | if(count) { 78 | $('body').append(this.tplBox); 79 | 80 | let ui = GM_getResourceText('ui'); 81 | let dom = document.getElementsByClassName('jae-userscript')[0] 82 | var tpl = ''; 83 | dom.innerHTML = tpl; 84 | var iframeDom = dom.children[0]; 85 | iframe.write(iframeDom, ui); 86 | 87 | this.execFrameJs(jaeFetchUserJSFrame.window); 88 | 89 | this.bindEvent(); 90 | } 91 | } 92 | } 93 | 94 | } 95 | 96 | ljs.exec(['jQuery', 'iframe', 'psl'], () => { 97 | let fu = new FetchUserjs(); 98 | fu.render(); 99 | }); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![userscript+.gif](https://cdn.rawgit.com/jae-jae/_resources/master/img/userscript+.gif) 2 | # Userscript+ 3 | 4 | [![Build Status](https://travis-ci.org/jae-jae/Userscript-Plus.svg?branch=master)](https://travis-ci.org/jae-jae/Userscript-Plus) 5 | [![Tampermonkey](https://img.shields.io/badge/Tampermonkey-up%20to%20date-green.svg)](https://tampermonkey.net/) 6 | [![webpack](https://img.shields.io/badge/webpack-3.x-orange.svg)](https://github.com/webpack/webpack) 7 | [![Vue](https://img.shields.io/badge/Vue-2.4%2B-yellow.svg)](https://vuejs.org/) 8 | [![iView](https://img.shields.io/badge/iView-2.2.0-brightgreen.svg)](https://www.iviewui.com) 9 | [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) 10 | [![i18n](https://img.shields.io/badge/i18n-PR-blue.svg)](https://github.com/jae-jae/Userscript-Plus/tree/master/src/common/lang) 11 | [![GitHub stars](https://img.shields.io/github/stars/jae-jae/Userscript-Plus.svg?style=social&label=Star&style=flat-square)](https://github.com/jae-jae/Userscript-Plus) 12 | 13 | > Show current site all UserJS,The easier way to install UserJs for Tampermonkey. 14 | 15 | **Userscript +** is a `Tampermonkey` user script, the role is when you browse the web, from the bottom right corner automatically for you to recommend the current page `Tampermonkey` script, and can install a designated script. 16 | 17 | Many times, we do not know whether some sites have users to provide the script to optimize the page, but **Userscript+** will be able to help you automatically find the applicable UserJS, and by default, according to the score from high to low order recommended to you, bring you a new `Tampermonkey` use experience! 18 | 19 | > - [中文说明](https://github.com/jae-jae/Userscript-Plus/blob/master/README-ZH.md) 20 | > - [Описание на русском](https://github.com/jae-jae/Userscript-Plus/blob/master/README-RU.md) 21 | 22 | ## Installation 23 | 1. Install the Chrome/Firefox plugin `Tampermonkey` 24 | 25 | Chrome Store: [https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo]( https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) 26 | 27 | Firefox addons:[https://addons.mozilla.org/en-US/firefox/addon/tampermonkey](https://addons.mozilla.org/en-US/firefox/addon/tampermonkey) 28 | 29 | 2. Install `Userscript+` 30 | 31 | You can install this script via `GreasyFork` or` GitHub`:: 32 | - GreasyFork: [https://greasyfork.org/en/scripts/24508](https://greasyfork.org/en/scripts/24508-userscript-show-site-all-userjs) 33 | - GitHub: [https://github.com/jae-jae/Userscript-Plus/raw/master/dist/show-site-all-userjs.user.js](https://github.com/jae-jae/Userscript-Plus/raw/master/dist/show-site-all-userjs.user.js) 34 | 35 | ### Userscript+ Chrome/Firefox extension 36 | ![](https://raw.githubusercontent.com/jae-jae/_resources/master/img/175033.png) 37 | - Chrome webstore:[https://chrome.google.com/webstore/detail/okiocdganiomklllkfkmhneoibegifch](https://chrome.google.com/webstore/detail/okiocdganiomklllkfkmhneoibegifch) 38 | 39 | - Github: [https://github.com/jae-jae/Userscript-Plus/raw/master/crx/extension.crx](https://github.com/jae-jae/Userscript-Plus/raw/master/crx/extension.crx) 40 | 41 | - Firefox Add-ons: [https://addons.mozilla.org/en-US/firefox/addon/userscript-for-tampermonkey](https://addons.mozilla.org/en-US/firefox/addon/userscript-for-tampermonkey) 42 | 43 | ## Features 44 | - Automatically appear in the lower right corner, recommend scripts for you, and will automatically disappear after 10 seconds 45 | - Filter the top 50 script with the highest score 46 | - The script list supports search filtering 47 | - The script list supports custom sorting 48 | - Supports one-click installation script 49 | - Support for viewing script details 50 | - Support access to the script home page and author home page 51 | - Click the close button, the current site `this session` all the pages will no longer appear prompt box 52 | - A prompt box is displayed only when found available script for the current site 53 | - i18n international multilingual support.(**[Locale contributions](https://github.com/jae-jae/Userscript-Plus/tree/master/src/common/lang) are welcomed!**) 54 | - Vue + iView UI design smooth and beautiful 55 | 56 | ## Whitelist and blacklist 57 | > Edit script => Settings tab => Includes/Excludes 58 | 59 | In the `Tampermonkey` to enter the script editing interface, select` Setting `tab, this tab below the` Includes/Excludes `option, set the white list and blacklist here, see Figure: 60 | 61 | ![us+en-ex.gif](https://cdn.rawgit.com/jae-jae/_resources/master/img/us+en-ex.gif) 62 | 63 | ## Known bug 64 | 65 | 1. In some sites below the plug-in interface icon is not displayed,Such as:Github 66 | 67 | **Reason**:This is because the security policy of these sites to prevent the plug-in icon font file loading, resulting in the icon does not display properly. 68 | 69 | ## Contribute 70 | 71 | If you are willing to contribute code to this project, please follow the [standard](https://standardjs.com/) specification. 72 | 73 | ## License 74 | MIT 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /README-RU.md: -------------------------------------------------------------------------------- 1 | ![userscript+.gif](https://cdn.rawgit.com/jae-jae/_resources/master/img/userscript+.gif) 2 | # Userscript+ 3 | 4 | [![Build Status](https://travis-ci.org/jae-jae/Userscript-Plus.svg?branch=master)](https://travis-ci.org/jae-jae/Userscript-Plus) 5 | [![Tampermonkey](https://img.shields.io/badge/Tampermonkey-up%20to%20date-green.svg)](https://tampermonkey.net/) 6 | [![webpack](https://img.shields.io/badge/webpack-3.x-orange.svg)](https://github.com/webpack/webpack) 7 | [![Vue](https://img.shields.io/badge/Vue-2.4%2B-yellow.svg)](https://vuejs.org/) 8 | [![iView](https://img.shields.io/badge/iView-2.2.0-brightgreen.svg)](https://www.iviewui.com) 9 | [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) 10 | [![i18n](https://img.shields.io/badge/i18n-PR-blue.svg)](https://github.com/jae-jae/Userscript-Plus/tree/master/src/common/lang) 11 | [![GitHub stars](https://img.shields.io/github/stars/jae-jae/Userscript-Plus.svg?style=social&label=Star&style=flat-square)](https://github.com/jae-jae/Userscript-Plus) 12 | 13 | > Показать пользовательские скрипты (UserJS) для текущего сайта. Легкий способ установить пользовательские скрипты для Tampermonkey. 14 | 15 | **Userscript +** пользовательский скрипт для Tampermonkey, который, когда вы заходите на сайты, автоматически предлагает во всплывающей подсказе в правом нижнем углу скрипты Tampermonkey для текущей страницы, и может установить выбранный скрипт. 16 | 17 | Зачастую, мы не знаем, что сайты имеют готовые скрипты для оптимизации страницы или сайта, но **Userscript+** поможет автоматически найти подходящие пользовательские скрипты, и по умолчанию, отсортирует их по рейтингу от высокого к низкому, что даёт тебе новый удобный способ использования `Tampermonkey`! 18 | 19 | > - [English description](https://github.com/jae-jae/Userscript-Plus/blob/master/README.md) 20 | > - [中文说明](https://github.com/jae-jae/Userscript-Plus/blob/master/README-ZH.md) 21 | 22 | ## Установка 23 | 1. Установите плагин `Tampermonkey` для Chrome/Firefox 24 | 25 | Интернет-магазин Chrome: [https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo]( https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) 26 | 27 | Дополнения Firefox: [https://addons.mozilla.org/ru/firefox/addon/tampermonkey](https://addons.mozilla.org/ru/firefox/addon/tampermonkey) 28 | 29 | 2. Установите `Userscript+` 30 | 31 | Вы можете установить этот скрипт через `GreasyFork` или` GitHub`: 32 | - GreasyFork: [https://greasyfork.org/ru/scripts/24508](https://greasyfork.org/ru/scripts/24508-userscript-show-site-all-userjs) 33 | - GitHub: [https://github.com/jae-jae/Userscript-Plus/raw/master/dist/show-site-all-userjs.user.js](https://github.com/jae-jae/Userscript-Plus/raw/master/dist/show-site-all-userjs.user.js) 34 | 35 | ### Userscript+ дополнение для Chrome/Firefox 36 | ![](https://raw.githubusercontent.com/jae-jae/_resources/master/img/175033.png) 37 | - Интернет-магазин Chrome:[https://chrome.google.com/webstore/detail/okiocdganiomklllkfkmhneoibegifch](https://chrome.google.com/webstore/detail/okiocdganiomklllkfkmhneoibegifch) 38 | 39 | - Github: [https://github.com/jae-jae/Userscript-Plus/raw/master/crx/extension.crx](https://github.com/jae-jae/Userscript-Plus/raw/master/crx/extension.crx) 40 | 41 | - Дополнения Firefox: [https://addons.mozilla.org/ru/firefox/addon/userscript-for-tampermonkey](https://addons.mozilla.org/ru/firefox/addon/userscript-for-tampermonkey) 42 | 43 | ## Что делает: 44 | - Автоматически отображает значок в правом нижнем углу страницы, рекомендуя скрипты, автоматически исчезает спустя 10 секунд 45 | - Отфильтровывет 50 скриптов с самым высоким рейтингом 46 | - Список скриптов имет поисковый фильтр 47 | - Список скриптов поддерживает произвольную сортировку 48 | - Поддерживает установку скрипта в один клик 49 | - Просмотр описания скрипта 50 | - Показывает ссылки на домашнюю страницу скрипта и автора 51 | - При нажатии кнопки "закрыть" всплывающий значок больше не появится на всех страницах сайта в `текущей сессии` 52 | - Всплывающий значок отображается только когда найдены доступные скрипты для текущего сайта 53 | - Поддержка многоязыковой интернализации i18n. (**[Содействие с локализацией](https://github.com/jae-jae/Userscript-Plus/tree/master/src/common/lang) приветствуется!**) 54 | - Vue + iView UI отзывчивый и приятный дизайн интерфейса. 55 | 56 | ## Белый список и Чёрный список 57 | > Редактировать скрипт => Вкладка настроек => Includes/Excludes 58 | 59 | В `Tampermonkey`, чтобы войти в интерфейс редактирования скрипта, выберите вкладку` Настройки `, нужная вкладка находится в опциях ` Includes/Excludes `, установите белый и чёрный список, смотрите пример: 60 | 61 | ![us+en-ex.gif](https://cdn.rawgit.com/jae-jae/_resources/master/img/us+en-ex.gif) 62 | 63 | ## Известные баги 64 | 65 | 1. На некоторых сайтах иконка интерфейса плагина не отображается,например: Github 66 | 67 | **Причина**: Это происходит из за того что, политики безопасности этих сайтов не позволяют файлу иконки плагина загрузиться, как результат не позволяя ей корректно отобразиться. 68 | 69 | ## Содействие 70 | 71 | Если вы желаете содействовать развитию проекта кодом, пожалуйста, прочитайте следующую [спецификацию стандарта](https://standardjs.com/). 72 | 73 | ## Лицензия 74 | MIT 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /dist/show-site-all-userjs.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Userscript+ : Show Site All UserJS 3 | // @name:zh Userscript+ : 显示当前网站所有可用的UserJS脚本 Jaeger 4 | // @name:zh-CN Userscript+ : 显示当前网站所有可用的UserJS脚本 Jaeger 5 | // @name:zh-TW Userscript+ : 顯示當前網站所有可用的UserJS腳本 Jaeger 6 | // @name:ja Userscript +:現在のサイトの利用可能なすべてのUserJSスクリプトを表示するJaeger 7 | // @name:ru-RU Userscript+ : Показать пользовательские скрипты (UserJS) для сайта. Jaeger 8 | // @name:ru Userscript+ : Показать пользовательские скрипты (UserJS) для сайта. Jaeger 9 | // @namespace https://github.com/jae-jae/Userscript-Plus 10 | // @version 2.4.0 11 | // @description Show current site all UserJS,The easier way to install UserJs for Tampermonkey. 12 | // @description:zh 显示当前网站的所有可用UserJS(Tampermonkey)脚本,交流QQ群:104267383 13 | // @description:zh-CN 显示当前网站的所有可用UserJS(Tampermonkey)脚本,交流QQ群:104267383 14 | // @description:zh-TW 顯示當前網站的所有可用UserJS(Tampermonkey)腳本,交流QQ群:104267383 15 | // @description:ja 現在のサイトで利用可能なすべてのUserJS(Tampermonkey)スクリプトを表示します。 16 | // @description:ru-RU Показывает пользовательские скрипты (UserJS) для сайта. Легкий способ установить пользовательские скрипты для Tampermonkey. 17 | // @description:ru Показывает пользовательские скрипты (UserJS) для сайта. Легкий способ установить пользовательские скрипты для Tampermonkey. 18 | // @author Jaeger 19 | // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII= 20 | // @include * 21 | // @require https://cdn.jsdelivr.net/gh/jae-jae/l.js/userjs/l.userjs.min.js 22 | // @require https://cdn.jsdelivr.net/gh/jae-jae/l.js@master/lib.js 23 | // @resource uiJs https://cdn.jsdelivr.net/gh/jae-jae/Userscript-Plus/dist/ui.js?_=1620545416123 24 | // @resource ui https://cdn.jsdelivr.net/gh/jae-jae/Userscript-Plus/dist/ui.html?_=1620545416123 25 | // @resource count https://greasyfork.org/scripts/by-site.json 26 | // @grant GM_xmlhttpRequest 27 | // @grant GM_getResourceText 28 | // @grant GM_getValue 29 | // @grant GM_setValue 30 | // @grant unsafeWindow 31 | // @noframes 32 | // @connect cdn.bootcss.com 33 | // @connect raw.githubusercontent.com 34 | // @connect gist.githubusercontent.com 35 | // @connect cdnjs.cloudflare.com 36 | // @connect greasyfork.org 37 | // @connect cdn.jsdelivr.net 38 | // @run-at document-end 39 | // ==/UserScript== 40 | 41 | unsafeWindow.GmAjax = GM_xmlhttpRequest; 42 | 43 | (function() { 44 | 45 | 'use strict'; 46 | 47 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 48 | 49 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 50 | 51 | var FetchUserjs = function () { 52 | function FetchUserjs() { 53 | _classCallCheck(this, FetchUserjs); 54 | 55 | this.host = this.getMainHost(); 56 | this.showTime = 10; 57 | this.quietKey = 'jae_fetch_userjs_quiet'; 58 | this.countKey = 'jae_fetch_userjs_count'; 59 | this.tplBox = '
'; 60 | } 61 | 62 | _createClass(FetchUserjs, [{ 63 | key: 'getMainHost', 64 | value: function getMainHost() { 65 | var host = window.location.hostname; 66 | return psl.get(host) || host.split('.').splice(-2).join('.'); 67 | } 68 | }, { 69 | key: 'getCountData', 70 | value: function getCountData(host) { 71 | var countData = GM_getResourceText('count'); 72 | countData = JSON.parse(countData); 73 | var count = countData[host]; 74 | sessionStorage.setItem(this.countKey, count); 75 | return count; 76 | } 77 | }, { 78 | key: 'setSize', 79 | value: function setSize(w, h) { 80 | $('.jae-userscript').css({ 81 | width: w, 82 | height: h 83 | }); 84 | } 85 | }, { 86 | key: 'addEventListener', 87 | value: function addEventListener(eventName, handler) { 88 | document.getElementById('jae_userscript_box').addEventListener(eventName, handler); 89 | } 90 | }, { 91 | key: 'bindEvent', 92 | value: function bindEvent() { 93 | var _this = this; 94 | 95 | this.timeId = setTimeout(function () { 96 | $('#jae_userscript_box').remove(); 97 | }, this.showTime * 1000); 98 | 99 | this.addEventListener('max', function () { 100 | _this.setSize(860, 492); 101 | $('.jae-userscript').addClass('jae-userscript-shadow'); 102 | clearTimeout(_this.timeId); 103 | }); 104 | 105 | this.addEventListener('min', function () { 106 | setTimeout(function () { 107 | $('.jae-userscript').removeClass('jae-userscript-shadow'); 108 | _this.setSize(370, 56); 109 | }, 500); 110 | }); 111 | 112 | this.addEventListener('close', function () { 113 | sessionStorage.setItem(_this.quietKey, 1); 114 | $('#jae_userscript_box').remove(); 115 | }); 116 | 117 | this.addEventListener('loading', function () { 118 | clearTimeout(_this.timeId); 119 | }); 120 | } 121 | }, { 122 | key: 'execFrameJs', 123 | value: function execFrameJs(frameWindow) { 124 | var uiJs = GM_getResourceText('uiJs'); 125 | return function (jsStr) { 126 | frameWindow.eval(jsStr); 127 | }.call(frameWindow, uiJs); 128 | } 129 | }, { 130 | key: 'render', 131 | value: function render() { 132 | if (!this.isQuiet) { 133 | var count = this.getCountData(this.host); 134 | if (count) { 135 | $('body').append(this.tplBox); 136 | 137 | var ui = GM_getResourceText('ui'); 138 | var dom = document.getElementsByClassName('jae-userscript')[0]; 139 | var tpl = ''; 140 | dom.innerHTML = tpl; 141 | var iframeDom = dom.children[0]; 142 | iframe.write(iframeDom, ui); 143 | 144 | this.execFrameJs(jaeFetchUserJSFrame.window); 145 | 146 | this.bindEvent(); 147 | } 148 | } 149 | } 150 | }, { 151 | key: 'isQuiet', 152 | get: function get() { 153 | var quiet = sessionStorage.getItem(this.quietKey); 154 | return quiet ? true : false; 155 | } 156 | }]); 157 | 158 | return FetchUserjs; 159 | }(); 160 | 161 | ljs.exec(['jQuery', 'iframe', 'psl'], function () { 162 | var fu = new FetchUserjs(); 163 | fu.render(); 164 | }); 165 | 166 | })(); 167 | -------------------------------------------------------------------------------- /dist/show-site-all-userjs.gf.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Userscript+ : Show Site All UserJS 3 | // @name:zh Userscript+ : 显示当前网站所有可用的UserJS脚本 Jaeger 4 | // @name:zh-CN Userscript+ : 显示当前网站所有可用的UserJS脚本 Jaeger 5 | // @name:zh-TW Userscript+ : 顯示當前網站所有可用的UserJS腳本 Jaeger 6 | // @name:ja Userscript +:現在のサイトの利用可能なすべてのUserJSスクリプトを表示するJaeger 7 | // @name:ru-RU Userscript+ : Показать пользовательские скрипты (UserJS) для сайта. Jaeger 8 | // @name:ru Userscript+ : Показать пользовательские скрипты (UserJS) для сайта. Jaeger 9 | // @namespace https://github.com/jae-jae/Userscript-Plus 10 | // @version 2.4.0 11 | // @description Show current site all UserJS,The easier way to install UserJs for Tampermonkey. 12 | // @description:zh 显示当前网站的所有可用UserJS(Tampermonkey)脚本,交流QQ群:104267383 13 | // @description:zh-CN 显示当前网站的所有可用UserJS(Tampermonkey)脚本,交流QQ群:104267383 14 | // @description:zh-TW 顯示當前網站的所有可用UserJS(Tampermonkey)腳本,交流QQ群:104267383 15 | // @description:ja 現在のサイトで利用可能なすべてのUserJS(Tampermonkey)スクリプトを表示します。 16 | // @description:ru-RU Показывает пользовательские скрипты (UserJS) для сайта. Легкий способ установить пользовательские скрипты для Tampermonkey. 17 | // @description:ru Показывает пользовательские скрипты (UserJS) для сайта. Легкий способ установить пользовательские скрипты для Tampermonkey. 18 | // @author Jaeger 19 | // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII= 20 | // @include * 21 | // @require https://greasyfork.org/scripts/23419-l-js/code/ljs.js 22 | // @require https://greasyfork.org/scripts/430303-l-lib2-js/code/l-lib2js.js 23 | // @resource uiJs https://cdn.jsdelivr.net/gh/jae-jae/Userscript-Plus/dist/ui.gf.js?_=1620545416123 24 | // @resource ui https://cdn.jsdelivr.net/gh/jae-jae/Userscript-Plus/dist/ui.html?_=1620545416124 25 | // @resource count https://greasyfork.org/scripts/by-site.json 26 | // @grant GM_xmlhttpRequest 27 | // @grant GM_getResourceText 28 | // @grant GM_getValue 29 | // @grant GM_setValue 30 | // @grant unsafeWindow 31 | // @noframes 32 | // @connect cdn.bootcss.com 33 | // @connect raw.githubusercontent.com 34 | // @connect gist.githubusercontent.com 35 | // @connect cdnjs.cloudflare.com 36 | // @connect greasyfork.org 37 | // @connect cdn.jsdelivr.net 38 | // @run-at document-end 39 | // ==/UserScript== 40 | 41 | unsafeWindow.GmAjax = GM_xmlhttpRequest; 42 | 43 | (function() { 44 | 45 | 'use strict'; 46 | 47 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 48 | 49 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 50 | 51 | var FetchUserjs = function () { 52 | function FetchUserjs() { 53 | _classCallCheck(this, FetchUserjs); 54 | 55 | this.host = this.getMainHost(); 56 | this.showTime = 10; 57 | this.quietKey = 'jae_fetch_userjs_quiet'; 58 | this.countKey = 'jae_fetch_userjs_count'; 59 | this.tplBox = '
'; 60 | } 61 | 62 | _createClass(FetchUserjs, [{ 63 | key: 'getMainHost', 64 | value: function getMainHost() { 65 | var host = window.location.hostname; 66 | return psl.get(host) || host.split('.').splice(-2).join('.'); 67 | } 68 | }, { 69 | key: 'getCountData', 70 | value: function getCountData(host) { 71 | var countData = GM_getResourceText('count'); 72 | countData = JSON.parse(countData); 73 | var count = countData[host]; 74 | sessionStorage.setItem(this.countKey, count); 75 | return count; 76 | } 77 | }, { 78 | key: 'setSize', 79 | value: function setSize(w, h) { 80 | $('.jae-userscript').css({ 81 | width: w, 82 | height: h 83 | }); 84 | } 85 | }, { 86 | key: 'addEventListener', 87 | value: function addEventListener(eventName, handler) { 88 | document.getElementById('jae_userscript_box').addEventListener(eventName, handler); 89 | } 90 | }, { 91 | key: 'bindEvent', 92 | value: function bindEvent() { 93 | var _this = this; 94 | 95 | this.timeId = setTimeout(function () { 96 | $('#jae_userscript_box').remove(); 97 | }, this.showTime * 1000); 98 | 99 | this.addEventListener('max', function () { 100 | _this.setSize(860, 492); 101 | $('.jae-userscript').addClass('jae-userscript-shadow'); 102 | clearTimeout(_this.timeId); 103 | }); 104 | 105 | this.addEventListener('min', function () { 106 | setTimeout(function () { 107 | $('.jae-userscript').removeClass('jae-userscript-shadow'); 108 | _this.setSize(370, 56); 109 | }, 500); 110 | }); 111 | 112 | this.addEventListener('close', function () { 113 | sessionStorage.setItem(_this.quietKey, 1); 114 | $('#jae_userscript_box').remove(); 115 | }); 116 | 117 | this.addEventListener('loading', function () { 118 | clearTimeout(_this.timeId); 119 | }); 120 | } 121 | }, { 122 | key: 'execFrameJs', 123 | value: function execFrameJs(frameWindow) { 124 | var uiJs = GM_getResourceText('uiJs'); 125 | return function (jsStr) { 126 | frameWindow.eval(jsStr); 127 | }.call(frameWindow, uiJs); 128 | } 129 | }, { 130 | key: 'render', 131 | value: function render() { 132 | if (!this.isQuiet) { 133 | var count = this.getCountData(this.host); 134 | if (count) { 135 | $('body').append(this.tplBox); 136 | 137 | var ui = GM_getResourceText('ui'); 138 | var dom = document.getElementsByClassName('jae-userscript')[0]; 139 | var tpl = ''; 140 | dom.innerHTML = tpl; 141 | var iframeDom = dom.children[0]; 142 | iframe.write(iframeDom, ui); 143 | 144 | this.execFrameJs(jaeFetchUserJSFrame.window); 145 | 146 | this.bindEvent(); 147 | } 148 | } 149 | } 150 | }, { 151 | key: 'isQuiet', 152 | get: function get() { 153 | var quiet = sessionStorage.getItem(this.quietKey); 154 | return quiet ? true : false; 155 | } 156 | }]); 157 | 158 | return FetchUserjs; 159 | }(); 160 | 161 | ljs.exec(['jQuery', 'iframe', 'psl'], function () { 162 | var fu = new FetchUserjs(); 163 | fu.render(); 164 | }); 165 | 166 | })(); 167 | -------------------------------------------------------------------------------- /crx/src/components/Table.vue: -------------------------------------------------------------------------------- 1 | 103 | 104 | 270 | 271 | -------------------------------------------------------------------------------- /src/components/Table.vue: -------------------------------------------------------------------------------- 1 | 117 | 118 | 314 | 315 | -------------------------------------------------------------------------------- /crx/extension/psl.min.js: -------------------------------------------------------------------------------- 1 | !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).psl=a()}}(function(){return function s(m,t,u){function r(o,a){if(!t[o]){if(!m[o]){var i="function"==typeof require&&require;if(!a&&i)return i(o,!0);if(p)return p(o,!0);var e=new Error("Cannot find module '"+o+"'");throw e.code="MODULE_NOT_FOUND",e}var n=t[o]={exports:{}};m[o][0].call(n.exports,function(a){return r(m[o][1][a]||a)},n,n.exports,s,m,t,u)}return t[o].exports}for(var p="function"==typeof require&&require,a=0;a= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=b-y,x=Math.floor,q=String.fromCharCode;function A(a){throw new RangeError(k[a])}function g(a,o){for(var i=a.length,e=[];i--;)e[i]=o(a[i]);return e}function l(a,o){var i=a.split("@"),e="";return 1>>10&1023|55296),a=56320|1023&a),o+=q(a)}).join("")}function L(a,o){return a+22+75*(a<26)-((0!=o)<<5)}function I(a,o,i){var e=0;for(a=i?x(a/t):a>>1,a+=x(a/o);c*f>>1x((d-l)/m))&&A("overflow"),l+=u*m,!(u<(r=t<=j?y:j+f<=t?f:t-j));t+=b)m>x(d/(p=b-r))&&A("overflow"),m*=p;j=I(l-s,o=c.length+1,0==s),x(l/o)>d-h&&A("overflow"),h+=x(l/o),l%=o,c.splice(l++,0,h)}return _(c)}function j(a){var o,i,e,n,s,m,t,u,r,p,k,c,g,l,h,j=[];for(c=(a=O(a)).length,o=w,s=v,m=i=0;mx((d-i)/(g=e+1))&&A("overflow"),i+=(t-o)*g,o=t,m=0;md&&A("overflow"),k==o){for(u=i,r=b;!(u<(p=r<=s?y:s+f<=r?f:r-s));r+=b)h=u-p,l=b-p,j.push(q(L(p+h%l,0))),u=x(h/l);j.push(q(L(u,0))),s=I(i,g,e==n),i=0,++e}++i,++o}return j.join("")}if(n={version:"1.4.1",ucs2:{decode:O,encode:_},decode:h,encode:j,toASCII:function(a){return l(a,function(a){return r.test(a)?"xn--"+j(a):a})},toUnicode:function(a){return l(a,function(a){return u.test(a)?h(a.slice(4).toLowerCase()):a})}},o&&i)if(T.exports==o)i.exports=n;else for(s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);else a.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[2])(2)}); 2 | --------------------------------------------------------------------------------