// ==UserScript== // @name pttchatonyoutube // @version 3.0.4 // @author Zoosewu, crimsonmoon9 // @description Connect ptt pushes to youtube chatroom // @match https://www.youtube.com/* // @match https://youtu.be/* // @match https://term.ptt.cc/* // @match https://hololive.jetri.co/* // @match https://www.twitch.tv/* // @match https://niji-mado.web.app/home // @match https://lin.ee/* // @match https://blank.org/* // @match https://holodex.net/* // @license MIT // @name:zh-TW Youtube聊天室顯示PTT推文 // @namespace https://github.com/zoosewu/PTTChatOnYoutube // @description:zh-tw 連結PTT推文到Youtube聊天室 讓你簡單追實況搭配推文 // @grant GM_xmlhttpRequest // @grant GM_info // @grant unsafeWindow // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_addValueChangeListener // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @run-at document-idle // @require https://code.jquery.com/jquery-3.5.1.slim.min.js // @require https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js // @require https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js // @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js // @require https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js // @require https://cdn.jsdelivr.net/npm/vuex@3.6.2/dist/vuex.min.js // @require https://cdn.jsdelivr.net/npm/xss@1.0.8/dist/xss.js // @require https://cdn.jsdelivr.net/npm/@akryuminfinitum/vue-virtual-scroller@1.0.11-canary.2/dist/vue-virtual-scroller.min.js // @homepageURL https://github.com/zoosewu/PTTChatOnYoutube/tree/master/homepage // @downloadURL none // ==/UserScript== /******/ (function (modules) { // webpackBootstrap /******/ // The module cache /******/ const installedModules = {} /******/ /******/ // The require function /******/ function __webpack_require__ (moduleId) { /******/ /******/ // Check if module is in cache /******/ if (installedModules[moduleId]) { /******/ return installedModules[moduleId].exports /******/ } /******/ // Create a new module (and put it into the cache) /******/ const module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ } /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__) /******/ /******/ // Flag the module as loaded /******/ module.l = true /******/ /******/ // Return the exports of the module /******/ return module.exports /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function (exports, name, getter) { /******/ if (!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }) /******/ } /******/ } /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function (exports) { /******/ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }) /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }) /******/ } /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function (value, mode) { /******/ if (mode & 1) value = __webpack_require__(value) /******/ if (mode & 8) return value /******/ if ((mode & 4) && typeof value === 'object' && value && value.__esModule) return value /******/ const ns = Object.create(null) /******/ __webpack_require__.r(ns) /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }) /******/ if (mode & 2 && typeof value !== 'string') for (const key in value) __webpack_require__.d(ns, key, function (key) { return value[key] }.bind(null, key)) /******/ return ns /******/ } /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function (module) { /******/ const getter = module && module.__esModule /******/ ? function getDefault () { return module.default } /******/ : function getModuleExports () { return module } /******/ __webpack_require__.d(getter, 'a', getter) /******/ return getter /******/ } /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function (object, property) { return Object.prototype.hasOwnProperty.call(object, property) } /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = '' /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 28) /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function (module, __webpack_exports__, __webpack_require__) { 'use strict' /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, 'a', function () { return normalizeComponent }) /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop const options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } let hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call( this, (options.functional ? this.parent : this).$root.$options.shadowRoot ) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functional component in vue file const originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook const existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }, /* 1 */ /***/ function (module, exports, __webpack_require__) { 'use strict' /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader // eslint-disable-next-line func-names module.exports = function (cssWithMappingToString) { const list = [] // return the list of modules as css string list.toString = function toString () { return this.map(function (item) { const content = cssWithMappingToString(item) if (item[2]) { return '@media '.concat(item[2], ' {').concat(content, '}') } return content }).join('') } // import a list of modules into the list // eslint-disable-next-line func-names list.i = function (modules, mediaQuery, dedupe) { if (typeof modules === 'string') { // eslint-disable-next-line no-param-reassign modules = [[null, modules, '']] } const alreadyImportedModules = {} if (dedupe) { for (let i = 0; i < this.length; i++) { // eslint-disable-next-line prefer-destructuring const id = this[i][0] if (id != null) { alreadyImportedModules[id] = true } } } for (let _i = 0; _i < modules.length; _i++) { const item = [].concat(modules[_i]) if (dedupe && alreadyImportedModules[item[0]]) { // eslint-disable-next-line no-continue continue } if (mediaQuery) { if (!item[2]) { item[2] = mediaQuery } else { item[2] = ''.concat(mediaQuery, ' and ').concat(item[2]) } } list.push(item) } } return list } /***/ }, /* 2 */ /***/ function (module, __webpack_exports__, __webpack_require__) { 'use strict' // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__) // EXPORTS __webpack_require__.d(__webpack_exports__, 'default', function () { return /* binding */ addStylesClient }) // CONCATENATED MODULE: ./node_modules/vue-style-loader/lib/listToStyles.js /** * Translates the list format produced by css-loader into something * easier to manipulate. */ function listToStyles (parentId, list) { const styles = [] const newStyles = {} for (let i = 0; i < list.length; i++) { const item = list[i] const id = item[0] const css = item[1] const media = item[2] const sourceMap = item[3] const part = { id: parentId + ':' + i, css: css, media: media, sourceMap: sourceMap } if (!newStyles[id]) { styles.push(newStyles[id] = { id: id, parts: [part] }) } else { newStyles[id].parts.push(part) } } return styles } // CONCATENATED MODULE: ./node_modules/vue-style-loader/lib/addStylesClient.js /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra Modified by Evan You @yyx990803 */ const hasDocument = typeof document !== 'undefined' if (typeof DEBUG !== 'undefined' && DEBUG) { if (!hasDocument) { throw new Error( 'vue-style-loader cannot be used in a non-browser environment. ' + "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." ) } } /* type StyleObject = { id: number; parts: Array } type StyleObjectPart = { css: string; media: string; sourceMap: ?string } */ const stylesInDom = {/* [id: number]: { id: number, refs: number, parts: Array<(obj?: StyleObjectPart) => void> } */} const head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) let singletonElement = null let singletonCounter = 0 let isProduction = false const noop = function () {} let options = null const ssrIdKey = 'data-vue-ssr-id' // Force single-tag solution on IE6-9, which has a hard limit on the # of