getDynamiqueClassName

get permanant changed ClassName

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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).
*/