Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @author BZHDeveloper, roger21
- // @name [HFR] Trouduc
- // @version 1.0.8
- // @namespace forum.hardware.fr
- // @description Colle les données du presse-papiers et les traite si elles sont reconnues.
- // @icon https://gitlab.com/BZHDeveloper/HFR/raw/master/hfr-logo.png
- // @downloadURL https://gitlab.com/BZHDeveloper/hfr/-/raw/master/hfr_cc.user.js
- // @updateURL https://gitlab.com/BZHDeveloper/hfr/-/raw/master/hfr_cc.user.js
- // @include https://forum.hardware.fr/*
- // @noframes
- // @grant GM_info
- // @grant GM.info
- // @grant GM.xmlHttpRequest
- // @grant GM_getValue
- // @grant GM_setValue
- // @grant GM_registerMenuCommand
- // @grant GM_xmlhttpRequest
- // ==/UserScript==
- let HFR = {
- Info : function() {
- var info = {};
- if (typeof (GM) !== "object")
- info = GM.info;
- else
- info = GM_info;
- this.extension = info.scriptHandler;
- var parts = info.version.split (".");
- this.version = {};
- if (parts.length > 0)
- this.version.major = parseInt (parts[0]);
- if (parts.length > 1)
- this.version.minor = parseInt (parts[1]);
- if (parts.length > 2)
- this.version.micro = parseInt (parts[2]);
- },
- IsGM4 : function(){
- var info = new this.Info();
- return info.extension == "GreaseMonkey" && info.version.major >= 4;
- },
- Regex : {
- Twitter : /^(https:\/\/(mobile\.)?twitter\.com\/\w+\/status\/\d+(\?s=\d+)?)$/g,
- Instagram : /^(https:\/\/(www\.)?instagram\.com\/p\/\w+\/)$/g,
- Telegram : /^(https:\/\/t\.me\/[a-z]+\/\d+)$/g,
- Minds : /^(https:\/\/www\.minds\.com\/newsfeed\/\d+)$/g,
- Sndup : /^(https:\/\/sndup\.net\/[a-z0-9]+\/d)$/g
- },
- Request : function (object) {
- if (this.IsGM4())
- return GM.xmlHttpRequest (object);
- else
- return GM_xmlhttpRequest (object);
- },
- SetValue : function (key, data) {
- if (!this.IsGM4()) {
- GM_setValue (key, data);
- return;
- }
- if (typeof (data) === "object")
- localStorage.setItem (GM.info.script.name + " :: " + key, JSON.stringify (data));
- else
- localStorage.setItem (GM.info.script.name + " :: " + key, data);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement