同时不能是基于 webview/iframe 的方案实现的
可以参考小程序。
模版文件 + js 的形式
模版文件定义页面,而 js 运行在 worker 中
| class ImageViewer { | |
| /** @type {string | undefined} */ | |
| url = void 0; | |
| /** @type {HTMLElement | undefined} */ | |
| $app = void 0; | |
| /** @type {HTMLElement | undefined} */ | |
| $img = void 0; | |
| /** @type {number} */ | |
| scaleRate = 1; |
| /** | |
| * 二叉树搜索 | |
| */ | |
| var arr = [5, 8, 10, 3, 1, 6, 9, 7, 2, 0, 4]; | |
| function search(searchValue) { | |
| var index = 0; | |
| var root = { |
收集几种方案,用于防止页面被打印出来。
页面失去焦点时,模糊页面,使其打印的页面也模糊。
有效:Chrome/Firefox 无效:IE (模糊无法使用,但可以在 IE 环境使其完全空白作为备选方案)
这个方案体验稍差
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>水印生成器</title> | |
| </head> | |
| <body> | |
| <div id="root"> | |
| <div> | |
| <div> |
| const babel = require('babel-core') | |
| const code = ` | |
| const abc = 1 + 2 // foo | |
| const defghijk = 3 + 4 // bar | |
| ` | |
| const result = babel.transform(code, { | |
| plugins: [require('./plugin')] | |
| }) |
$ codesign -dvvv /Applications/云盒子.app/
Executable=/Applications/云盒子.app/Contents/MacOS/云盒子
Identifier=cloudoc
Format=app bundle with Mach-O thin (x86_64)
CodeDirectory v=20500 size=1747 flags=0x10000(runtime) hashes=46+5 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha1=f9f5ad4252b097b1ff33c9d1102f8599f139f207
CandidateCDHashFull sha1=f9f5ad4252b097b1ff33c9d1102f8599f139f207
CandidateCDHash sha256=ebfa600510ea8d96807d8d1f033271148e4c9fec| function glob2regexp(glob) { | |
| const prefix = "^/?(.*/)*"; | |
| const suffix = "$"; | |
| const content = glob | |
| .replace(/\./g, ".") | |
| .replace(/\*{2,}/, "**") | |
| .replace(/\*{1,}\/?/g, function (match, b, c, d) { | |
| const matchSlash = match[match.length - 1] === "/"; | |
| match = !matchSlash ? match : match.substr(0, match.length - 1); |
| .flex { | |
| display: flex; | |
| } | |
| .row { | |
| position: relative; | |
| height: auto; | |
| margin-right: 0; | |
| margin-left: 0; | |
| zoom: 1; |