Last active
August 17, 2020 07:40
-
-
Save triacontane/c9c98a3a975f4d1d3ccc1938650b975b to your computer and use it in GitHub Desktop.
実行しているプラグインのファイル名を取得する。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
var script = document.currentScript; | |
var pluginName = script.src.replace(/^.*\/(.*).js$/, function() { | |
return arguments[1]; | |
}); | |
console.log(pluginName); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
確認したところ、うまく動作せず「一番最後に読み込んだスクリプト」を常に取得していたので「document.currentScript」で取得するよう修正。対応状況は問題ない……はず。