用于混淆 html 和 css 的工具

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7278863/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 10:24:16  来源:igfitidea点击:

tools for obfuscating html and css

htmlcssobfuscationminify

提问by Adam Ramadhan

I am looking for something like thisor this

我正在寻找这样这样的东西

what it does

它能做什么

rewrites classes and ids in CSS, HTML, and JavaScript files, doing something like .class to .a or #id to #a not sure the javascript obfu is great to use ( i prefer google closure to do this ) but the html and css is the question.

重写 CSS、HTML 和 JavaScript 文件中的类和 id,执行类似 .class 到 .a 或 #id 到 #a 的操作,不确定 javascript obfu 是否很好用(我更喜欢 google 关闭来执行此操作),但是 html 和 css是问题。

is there any alternative ?

有没有其他选择?

回答by Jerome

Google's Closure Stylesheetscan rename your class names. It work in conjunction with Closure Templatefor the HTML and Closure Compilerfor the JavaScript.

Google 的Closure Stylesheets可以重命名您的类名。它与用于 HTML 的闭包模板和用于 JavaScript 的闭包编译器结合使用。

Closure Stylesheets makes it possible to rename CSS class names in the generated stylesheet, which helps reduce the size of the CSS that is sent down to your users. Of course, this is not particularly useful unless the class names are renamed consistently in the HTML and JavaScript files that use the CSS. Fortunately, you can use the Closure Compiler to update the class names in your JavaScript and Closure Templates to update the class names in your HTML.

Closure Stylesheets 可以在生成的样式表中重命名 CSS 类名称,这有助于减少发送给用户的 CSS 的大小。当然,除非在使用 CSS 的 HTML 和 JavaScript 文件中一致地重命名类名,否则这不是特别有用。幸运的是,您可以使用闭包编译器来更新 JavaScript 中的类名,并使用闭包模板来更新 HTML 中的类名。

回答by tobymackenzie

I saw html munchermentioned in an answer to a similar question. I have not tried it, but it looks to be as simple to use as what you mentioned in your comment on Jerome's answer. It doesn't look to be actively maintained though.

我在一个类似问题的回答中看到了html muncher。我没有尝试过,但它看起来和你在对杰罗姆的回答的评论中提到的一样简单。不过,它看起来并没有得到积极维护。

[Update] I also found a similar node project, munch.js, that says it is based on html muncher.

[更新] 我还发现了一个类似的节点项目,munch.js,它说它基于 html muncher。