// ==UserScript== // @author nht.ctn // @name [PSA] Quick Search // @namespace https://github.com/nhtctn // @version 1 // @description It adds PSA quick search buttons for IMDB and Subscene // @icon https://images2.imgbox.com/26/c1/2OXmz3tN_o.png // @license MIT // @match *://psa.pm/tv-show/* // @match *://psa.pm/movie/* // @match *://subscene.com/subtitles/title?q=* // @run-at document-end // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js // @require https://greasyfork.org/scripts/427315-url-based-search-for-some-websites/code/URL%20Based%20Search%20for%20Some%20Websites.js?version=936416 // @downloadURL none // ==/UserScript== /*jshint esversion: 6 */ /* global $ */ (function() { 'use strict'; var PlanetDP = [ {psa: '1', name: 'Subscene', url_title: 'http://subscene.com/subtitles/title?q=%title%',}, {psa: '1', name: 'IMDb', url_title: 'https://www.imdb.com/find/?q=%title%',}, ]; // Common Used Vars var pageUrl = window.location.href; var titleArea; var title; var year = ""; if (pageUrl.search(/psa\.pm\/(tv-show|movie)\//) >= 0 && PlanetDP[0].psa == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% { const html = () => { var h = ''; for( var i = 0, len = PlanetDP.length; i < len; i++ ) { var p = PlanetDP[i]; if (p.psa == 1) { h += '