// ==UserScript== // @name FR:ES - Viewer // @namespace https://www.reddit.com/user/RobotOilInc // @version 0.1.8 // @description Show all QCs in TaoBao and Yupoo // @author RobotOilInc // @match http://*/* // @grant none // @license MIT // @include /^https?://((?:item|2)\.taobao|detail\.tmall)\.com/(item|meal_detail)\.(htm|html)\?/ // @include /^https?://world.(?:taobao|tmall).com/item/\d+.htm/ // @include /^https?://world.(?:taobao|tmall).com/item/\d+.html/ // @include /^https?://.*\.x\.yupoo\.com/albums/\d+/ // @require https://unpkg.com/js-logger@1.6.1/src/logger.min.js // @require https://unpkg.com/jquery@3.6.0/dist/jquery.min.js // @require https://unpkg.com/@sentry/browser@6.4.1/build/bundle.min.js // @require https://unpkg.com/@sentry/tracing@6.4.1/build/bundle.tracing.min.js // @require https://unpkg.com/swagger-client@3.13.3/dist/swagger-client.browser.min.js // @require https://unpkg.com/iframe-resizer@4.3.2/js/iframeResizer.min.js // @run-at document-end // @downloadURL none // ==/UserScript== const _SWAGGER_DOC_URL = 'https://localhost:8000/api/doc.json'; const _DOMAINS = ['https://localhost:8000', 'https://fashionreps.tools']; const _VERSION = GM_info.script.version; // eslint-disable-next-line func-names (async function () { // Setup the logger. Logger.useDefaults(); // Log the start of the script. Logger.info(`Starting extension, version ${_VERSION}`); // Setup Sentry for proper error logging, which will make my lives 20x easier, use XHR since fetch dies. Sentry.init({ dsn: 'https://1aba703afc924f0599f88318974b96d6@o740964.ingest.sentry.io/5791114', integrations: [new Sentry.Integrations.BrowserTracing()], transport: Sentry.Transports.XHRTransport, release: `viewer-${_VERSION}`, environment: 'production', }); /** @type {SwaggerClient} */ let client; // Try to create Swagger client from our own documentation try { client = await new SwaggerClient({ url: _SWAGGER_DOC_URL }); } catch (error) { Logger.error(`We are unable to connect to FR:ES: ${_SWAGGER_DOC_URL}`, error); Sentry.captureException(error); return; } const $iframe = $('