kopia lustrzana https://github.com/robinmoisson/staticrypt
use custom named file for crypto-js instead of cdn (blocked by adblockers)
rodzic
c7e1b5c3b4
commit
758e12440d
|
@ -28,7 +28,7 @@ Staticrypt is available through npm as a CLI, install with `npm install -g stati
|
|||
--help Show help [boolean]
|
||||
--version Show version number [boolean]
|
||||
-e, --embed Whether or not to embed crypto-js in the page (or use an
|
||||
external CDN) [boolean] [default: false]
|
||||
external CDN) [boolean] [default: true]
|
||||
-o, --output File name / path for generated encrypted file
|
||||
[string] [default: null]
|
||||
-t, --title Title for output HTML page
|
||||
|
@ -46,4 +46,6 @@ Example usages:
|
|||
|
||||
You can use a custom template for the password prompt - just copy `cli/password_template.html` and modify it to suit your presentation style and point to your template file with the `-f` flag. Be careful to not break the encrypting javascript part, the variables replaced by staticrypt are between curly brackets: `{instructions}`.
|
||||
|
||||
**ADBLOCKERS**: If you do not embed crypto-js and serve it from a CDN, some adblockers see the `crypto-js.min.js`, think that's a crypto miner and block it.
|
||||
|
||||
Thanks [Aaron Coplan](https://github.com/AaronCoplan) for bringing the CLI to life !
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
</footer>
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js" integrity="sha384-lp4k1VRKPU9eBnPePjnJ9M2RF3i7PC30gXs70+elCVfgwLwx1tv5+ctxdtwxqZa7" crossorigin="anonymous"></script>
|
||||
<script src="kryptojs-3.1.9-1-lib.js"></script>
|
||||
|
||||
<script>
|
||||
document.getElementById('staticrypt-form').addEventListener('submit', function(e) {
|
||||
|
|
14
index.html
14
index.html
|
@ -122,7 +122,8 @@
|
|||
<label class="no-style">
|
||||
<input type="checkbox" id="embed-crypto" checked>
|
||||
Embed crypto-js into your file
|
||||
<abbr title="Leave checked to include crypto-js into your file so you can decrypt it offline. Uncheck to load crypto-js from a CDN.">?</abbr>
|
||||
<abbr title="Leave checked to include crypto-js into your file so you can decrypt it offline.
|
||||
Uncheck to load crypto-js from a CDN (some adblockers might think it's a crypto miner).">?</abbr>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
@ -144,9 +145,12 @@ Your encrypted string</pre>
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js"
|
||||
integrity="sha384-lp4k1VRKPU9eBnPePjnJ9M2RF3i7PC30gXs70+elCVfgwLwx1tv5+ctxdtwxqZa7"
|
||||
crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Crypto JS 3.1.9-1
|
||||
Copied as is from https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.js
|
||||
Filename changed to circumvent adblockers that mistake it for a crypto miner (see https://github.com/robinmoisson/staticrypt/issues/107)
|
||||
-->
|
||||
<script src="kryptojs-3.1.9-1-lib.js"></script>
|
||||
|
||||
<script src="https://cdn.ckeditor.com/4.7.0/standard/ckeditor.js"></script>
|
||||
|
||||
|
@ -187,7 +191,7 @@ Your encrypted string</pre>
|
|||
*/
|
||||
var setFileToDownloadWithEmbeddedCrypto = function (data) {
|
||||
var request = new XMLHttpRequest();
|
||||
request.open('GET', 'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js', true);
|
||||
request.open('GET', 'kryptojs-3.1.9-1-lib.js', true);
|
||||
request.onload = function() {
|
||||
data['crypto_tag'] = '<script>' + request.responseText + '</scr' + 'ipt>';
|
||||
setFileToDownload(data);
|
||||
|
|
Plik diff jest za duży
Load Diff
Ładowanie…
Reference in New Issue