window.alert = function (obj) {
	var iframe = document.createElement('iframe');
	iframe.src = 'javascript:void(0);'
	document.body.appendChild(iframe)
	iframe.contentWindow.alert(obj);
	iframe.parentNode.removeChild(iframe);
}

window.hugo={}
window.hugo.iframes=[]
let iframes=window.hugo.iframes;
var openIframe=function(html,body){
	// 1. 创建<iframe>元素
	var ifr = document.createElement('iframe');
//	// 2. 将CSS,HTML字符串转换为Blob对象
//	var blob = new Blob([html], {
//	  'type': 'text/html'
//	});
//	// 3. 使用URL.createObjectURL()方法将...
//	iframe.src = URL.createObjectURL(blob);
	body.innerHTML = "";
	body.appendChild(ifr);
	var ifrw = (ifr.contentWindow) ? ifr.contentWindow: (ifr.contentDocument.document) ? ifr.contentDocument.document: ifr.contentDocument;
	ifrw.document.open();
	ifrw.document.write(html);
	ifrw.document.close();
	//console.log(x)
}
//开启页面html
{

    let xx = $("#cnblogs_post_body,.cnblogs-post-body").find("[data-type=html]");
    let xxx = [];
    for (let x of xx) {
        xxx.push(x.innerText)
    };
    xx.remove();
    let URL = window.URL || window.webkitURL;
    for (let x of xxx) {
		//openIframe(x,document.body)
		iframes.push(x);
    };
}

在线web编辑器

html在线调试

https://codepen.io/

https://jsbin.com/

https://jsfiddle.net/

https://jsrun.net/

wasm

https://wasdk.github.io/WasmFiddle/

http://mbebenita.github.io/WasmExplorer/

仿vscode在线IDE

https://coder.com 【开源】【code-server】【docker】

https://stackblitz.com/  【简单的拖拽就能将本地的项目文件直接导入】【StackBlitz 还利用 Progressive Web App API’s 在浏览器中运行了一个 live dev server,这样即使在离线条件下依然可用】

https://codesandbox.io/ 【开源】【BrowserFS 浏览器内文件系统】

在线编辑器

https://microsoft.github.io/monaco-editor/index.html 【vscode编辑器】

posted @ 2019-04-24 16:01  离线云  阅读(488)  评论(0编辑  收藏  举报