Skip to content

Commit 6cfcf10

Browse files
committed
update extension
1 parent 655fa68 commit 6cfcf10

25 files changed

Lines changed: 74563 additions & 51 deletions

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Web2Vector — Chrome Extension
1+
# Web2Vector — Chrome and Firefox Extension
22

3-
A Chrome extension that exports any web page's rendered DOM to **10 output formats** using the [@node-projects/layout2vector](https://github.com/node-projects/layout2vector) library.
3+
A browser extension that exports any web page's rendered DOM to **10 output formats** using the [@node-projects/layout2vector](https://github.com/node-projects/layout2vector) library.
44

55
<p align="center">
66
<img src="src/icons/icon.svg" width="128" alt="Web2Vector icon" />
@@ -23,7 +23,7 @@ A Chrome extension that exports any web page's rendered DOM to **10 output forma
2323

2424
## Usage
2525

26-
1. Click the **Web2Vector** icon in the Chrome toolbar.
26+
1. Click the **Web2Vector** icon in the browser toolbar.
2727
2. Pick an export format from the popup menu.
2828
3. A **Save As** dialog appears — choose where to save the file.
2929

@@ -71,6 +71,12 @@ npm run build:all
7171
2. Enable **Developer mode** (top right)
7272
3. Click **Load unpacked** → select the `dist/` folder
7373

74+
### Load in Firefox
75+
76+
1. Navigate to `about:debugging#/runtime/this-firefox`
77+
2. Click **Load Temporary Add-on**
78+
3. Select the `manifest.json` file inside `dist-firefox/`
79+
7480
### Test
7581

7682
```bash
@@ -80,7 +86,9 @@ npm test
8086
### Package for Distribution
8187

8288
```bash
83-
npm run package # creates web2vector-<version>.zip
89+
npm run package # creates web2vector-chrome-<version>.zip
90+
npm run package:firefox # creates web2vector-firefox-<version>.zip
91+
npm run package:all-browsers # creates both ZIPs
8492
```
8593

8694
## Publishing to Chrome Web Store
@@ -106,7 +114,7 @@ Then create a GitHub Release to trigger the publish workflow, or use the manual
106114
## Project Structure
107115

108116
```
109-
├── manifest.json Chrome extension manifest (v3)
117+
├── manifest.json Chrome source manifest (v3)
110118
├── esbuild.config.mjs Build configuration
111119
├── src/
112120
│ ├── shared/formats.js Format definitions (shared by popup + background)
@@ -125,6 +133,7 @@ Then create a GitHub Release to trigger the publish workflow, or use the manual
125133
│ └── icon.svg Source icon
126134
├── scripts/
127135
│ ├── build-icons.mjs SVG → PNG conversion
136+
│ ├── manifest-utils.mjs Browser-specific manifest helpers
128137
│ ├── package-extension.mjs ZIP packaging
129138
│ └── upload-to-store.mjs Chrome Web Store upload
130139
├── tests/

dist-firefox/acad-writers.js

Lines changed: 59201 additions & 0 deletions
Large diffs are not rendered by default.

dist-firefox/core-lib.js

Lines changed: 11697 additions & 0 deletions
Large diffs are not rendered by default.

dist-firefox/dxf-writer.js

Lines changed: 2742 additions & 0 deletions
Large diffs are not rendered by default.

dist-firefox/icons/icon128.png

12.8 KB
Loading

dist-firefox/icons/icon16.png

662 Bytes
Loading

dist-firefox/icons/icon32.png

1.61 KB
Loading

dist-firefox/icons/icon48.png

3.06 KB
Loading

dist-firefox/manifest.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"manifest_version": 3,
3+
"name": "Web2Vector",
4+
"description": "Export any web page to SVG, DXF, DWG, EMF, PDF, HTML, PNG, JPEG, or WebP using layout2vector",
5+
"version": "1.0.0",
6+
"icons": {
7+
"16": "icons/icon16.png",
8+
"32": "icons/icon32.png",
9+
"48": "icons/icon48.png",
10+
"128": "icons/icon128.png"
11+
},
12+
"action": {
13+
"default_popup": "popup.html",
14+
"default_icon": {
15+
"16": "icons/icon16.png",
16+
"32": "icons/icon32.png",
17+
"48": "icons/icon48.png"
18+
},
19+
"default_title": "Web2Vector — Export page"
20+
},
21+
"permissions": [
22+
"activeTab",
23+
"downloads",
24+
"scripting",
25+
"contextMenus"
26+
],
27+
"background": {
28+
"scripts": [
29+
"service-worker.js"
30+
]
31+
}
32+
}

dist-firefox/popup.css

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
box-sizing: border-box;
5+
}
6+
7+
body {
8+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
9+
width: 280px;
10+
background: #fafafa;
11+
color: #222;
12+
}
13+
14+
.popup {
15+
padding: 12px;
16+
}
17+
18+
.header {
19+
display: flex;
20+
align-items: center;
21+
gap: 8px;
22+
margin-bottom: 12px;
23+
padding-bottom: 8px;
24+
border-bottom: 1px solid #e0e0e0;
25+
}
26+
27+
.header h1 {
28+
font-size: 15px;
29+
font-weight: 600;
30+
}
31+
32+
.logo {
33+
border-radius: 6px;
34+
}
35+
36+
/* ── Category groups ── */
37+
.category-label {
38+
font-size: 10px;
39+
font-weight: 700;
40+
text-transform: uppercase;
41+
letter-spacing: 0.6px;
42+
color: #888;
43+
margin: 10px 0 4px;
44+
}
45+
46+
.category-label:first-child {
47+
margin-top: 0;
48+
}
49+
50+
/* ── Format buttons ── */
51+
.format-btn {
52+
display: flex;
53+
align-items: center;
54+
width: 100%;
55+
padding: 8px 10px;
56+
border: 1px solid #e0e0e0;
57+
border-radius: 8px;
58+
background: #fff;
59+
cursor: pointer;
60+
font-size: 13px;
61+
color: #333;
62+
transition: background 0.15s, border-color 0.15s;
63+
margin-bottom: 4px;
64+
}
65+
66+
.format-btn:hover {
67+
background: #e3f2fd;
68+
border-color: #90caf9;
69+
}
70+
71+
.format-btn:active {
72+
background: #bbdefb;
73+
}
74+
75+
.format-btn:disabled {
76+
opacity: 0.5;
77+
cursor: not-allowed;
78+
}
79+
80+
.format-btn .ext {
81+
margin-left: auto;
82+
font-size: 11px;
83+
color: #999;
84+
font-family: 'SFMono-Regular', Consolas, monospace;
85+
}
86+
87+
/* ── Status bar ── */
88+
.status {
89+
margin-top: 10px;
90+
padding: 8px 10px;
91+
border-radius: 8px;
92+
font-size: 12px;
93+
text-align: center;
94+
}
95+
96+
.status.hidden {
97+
display: none;
98+
}
99+
100+
.status.loading {
101+
background: #e3f2fd;
102+
color: #1565c0;
103+
}
104+
105+
.status.success {
106+
background: #e8f5e9;
107+
color: #2e7d32;
108+
}
109+
110+
.status.error {
111+
background: #ffebee;
112+
color: #c62828;
113+
}

0 commit comments

Comments
 (0)