Codeskulptor AddOn

If the first lines of code have the comment #title=New Title, the page title is renamed to New Title. If the comment is #autorun, the code is automatically run.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Codeskulptor AddOn
// @namespace    https://greasyfork.org/users/4756
// @author       saibotshamtul (Michael Cimino)
// @version      0.3.3
// @description  If the first lines of code have the comment #title=New Title, the page title is renamed to New Title. If the comment is #autorun, the code is automatically run.
// @match        http://www.codeskulptor.org/*
// @copyright    2012+, Saibotshamtul
// @grant        none
// ==/UserScript==
// previous version available at http://userscripts-mirror.org/scripts/source/179891.user.js

function ParseCode(){
   	for (z=1;z<4;z++) {
        t = document.querySelector(".CodeMirror-code div:nth-child("+z+") pre span span").innerHTML;
    	if (t.substring(0,7)=="#title=") {
        	document.title=t.substring(7,t.length);
    	}
    	if (t.substring(0,8)=="#autorun"){
        	document.querySelector("#run").click()
	    }
	}
    delete t
    delete z
}

window.setTimeout(ParseCode,1000);