getDynamiqueClassName

get permanant changed ClassName

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         getDynamiqueClassName
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  get permanant changed ClassName
// @author       MeGa
// @match        YourUrl*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
// @grant        God
// ==/UserScript==

var innerHTML = document.body.innerHTML;
var targetFix = "";
var target = innerHTML.indexOf(targetFix);
var begin = target - 90; /*begin classeName aproximatif ---*/
var end = target - 65; /*end classeName approximatif +++*/

var cibleImage = innerHTML.substring(begin, end);

var appo = cibleImage.lastIndexOf('"');
if (appo !== -1) {
    var DecaleLeft = cibleImage.length - appo;
    var newCibleImage = innerHTML.substring(begin, end - DecaleLeft);
    var appoNCI = newCibleImage.indexOf('"');
    if (appoNCI !== -1) {
        var cutBeginToAppo = appoNCI + 1;
        var classImg = innerHTML.substring(begin + cutBeginToAppo, end - DecaleLeft);

    } else {
        var classImg = newCibleImage;
    }
} else {
    var classImg = cibleImage;
}

console.log(classImg);

/*exp:   
<span class="sign-out-link">[ <a rel="nofollow" data-method="delete" href="/fr/users/sign_out">Se déconnecter</a> ]</span>
here: targetFix = "Se déconnecter";
      begin = target -90; /*the differnece between the begining of the class name (taking a margin befor the beginin of 03 positions) 
      end = target -65; the differnece between the end of the class name (taking a margin after the beginin 03 positions).
*/