• Stars
    star
    1,267
  • Rank 37,138 (Top 0.8 %)
  • Language
    JavaScript
  • Created about 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bundle web files into a single image

Web2Img

Web2Img is a tool to bundle your web files into a single image, and extract them via Service Worker at runtime.

You can use image hosting sites as free CDNs to save bandwidth costs.

intro.png

Tool

Try It Online: https://etherdream.github.io/web2img/

OR: https://etherdream.com/web2img/ (latest)

demo.mp4

Example

Demo: https://fanhtml5.github.io

Target Files: https://github.com/fanhtml5/fanhtml5.github.io (only 2 files)

Source Files: https://github.com/fanhtml5/test-site

FAQ

Q: What if JavaScript is disabled?

A: Unfortunately, the page can't be displayed. You can add a fallback in 404.html such as:

<noscript>
  <meta http-equiv=Refresh content="0;url=FALLBACK_URL">
</noscript>
<script src=/x.js></script>

Q: What if the browser doesn't support Service Worker?

A: Same as above. The program will read the contents of <noscript> and render them.


Q: Is free CDN safe?

A: Yes, the program will verify the data integrity.


Q: Is free CDN stable?

A: Not sure, but you can provide multiple URLs to improve stability.


Q: Can any free CDN be used?

A: No, CDN must enable CORS, allow empty referrer and "null" origin (or real value).


Q: Would it be better to optimize the image before uploading?

A: If the server will re-encode the image, it makes no difference.


Q: Why use 404.html?

A: It's an easy way to intercept any path.


Q: How to update files?

A: Just overwrite x.js, the client polls this file every 2 minutes.


Q: Will new features be added?

A: This project is just an experiment, there is a new project named freecdn which is much more powerful. (better docs will be released soon)

License

MIT

More Repositories

1

jsproxy

An online proxy based on ServiceWorker
Shell
9,309
star
2

freecdn

A front-end CDN based on ServiceWorker
JavaScript
980
star
3

web-frontend-magic

#前端黑魔法# 整理
783
star
4

http-server-online

Start a local HTTP server without any tools, just open a web page.
JavaScript
629
star
5

jsproxy-browser

jsproxy 浏览器端程序
JavaScript
286
star
6

js-port-knocking

Web 端口敲门的奇思妙想
HTML
237
star
7

myppt

189
star
8

headphone-morse-transmitter

Send Morse code via ⏸️ ⏯️ ⏮️
HTML
177
star
9

QuickReader

An ultra-high performance stream reader for browser and Node.js
TypeScript
168
star
10

WebScrypt

a fast and lightweight scrypt hash algorithm for browser
JavaScript
152
star
11

decent-cdn

网站 CDN 去中心化尝试
JavaScript
130
star
12

https_hijack_demo

HTTPS Frontend Hijack
JavaScript
92
star
13

mitm-http-cache-poisoning

HTTP Cache Poisoning Demo
JavaScript
87
star
14

sw-sec

Service Worker 安全探索
HTML
73
star
15

str2gbk

JS 字符串转 GBK 编码超轻量实现
JavaScript
53
star
16

toh

TCP over HTTP. 隐藏网站的管理服务
JavaScript
43
star
17

cookie_hijack_demo

MITM cookie sniffer
JavaScript
35
star
18

timelock

A time-lock puzzle designed for browsers
TypeScript
27
star
19

freecdn-js

freecdn browser side files
TypeScript
26
star
20

xss_ghost

XSS 跨窗口劫持
JavaScript
20
star
21

proof-of-work-hashcash

Proof-of-Work Hashcash demo
JavaScript
17
star
22

gzip-js-injector

GZIP 页面零开销注入 JS 演示
JavaScript
14
star
23

6502-to-js-test

HTML
9
star
24

mini-program-pack

小程序静态资源打包和压缩
JavaScript
9
star
25

freecdn-publib

public lib database for freecdn
JavaScript
6
star
26

freecdn-update-svc

TypeScript
6
star
27

test

just test
JavaScript
4
star
28

jsproxy-bin

3
star
29

js-anti-ddos

使用浏览器端 JS 防御 DDOS 攻击
3
star
30

jsproxy-localtest

HTML
3
star
31

etherdream.github.io

2
star
32

setupsw

2
star
33

parallel-pbkdf2

The best password hashing solution in browser
HTML
2
star
34

cloudshellproxy

1
star
35

free-host-test

JavaScript
1
star
36

webworker.swc

HTML5-style Worker For Flash
ActionScript
1
star