在新窗口中单独显示稻壳(道客)网的单页内容,便于完整的打印某一页。
// ==UserScript==
// @name 复制稻壳 - doc88.com
// @namespace Violentmonkey Scripts doc88
// @match *://www.doc88.com/*
// @grant none
// @version 1.0
// @author -
// @description 2020/3/5 上午9:02:22
// ==/UserScript==
$(document).ready(function () {
var btn05 = $("<input type='button' id='wzmBtn' value='显示当前页' style='height:50px;font-size: 14px; position: fixed; left: 00px; top: 300px;z-index:65536'>");
$("body").append(btn05);
document.getElementById("wzmBtn").addEventListener("click", function () {
showtext();
});
});
function showtext() {
var canName = "page_" + document.getElementById("pageNumInput").value;
var canvas = document.getElementById(canName);
var dataUrl = canvas.toDataURL();
$("#div01").css("background-image",dataUrl);
window.open(dataUrl, "toDataURL() image");
}