Print the code of this user script
当前为
// ==UserScript==
// @name Print Own Code
// @namespace your-namespace
// @version 1.0
// @description Print the code of this user script
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Function to print the script code
function printScriptCode() {
const scriptElements = document.querySelectorAll('script');
for (const script of scriptElements) {
if (script.src === '' && script.textContent.includes('// ==UserScript==')) {
console.log(script.textContent);
}
}
}
// Call the function to print the script code
printScriptCode();
})();