Skip to content

Commit 55ca061

Browse files
authored
Merge pull request #2 from tomaschyly/version/2.3.0
Version/2.3.0
2 parents bcdaf47 + f603a53 commit 55ca061

13 files changed

Lines changed: 203 additions & 41 deletions

File tree

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ ModWe is a Chromium browser extension that modifies websites using user-defined
44

55
These instructions apply to the whole repository unless a deeper `AGENTS.md` overrides them.
66

7+
## Branch safety rule
8+
9+
- For implementation work (any non-planning/non-question-only task), if current branch is `main` or `master`, ask the user first whether to switch to a new `version/*` or `feature/*` branch before making edits.
10+
- Do not start code changes on `main`/`master` until the user confirms how to proceed.
11+
712
## Release versioning rule
813

914
- Files that must be updated for each extension version bump:

README.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,48 @@
11
# ModWe
22

3-
Originally for Firefox (v1.x.x), now for browsers based on Chromium (v2.x.x) extension to modify websites using custom CSS and JS snippets.
3+
ModWe is a Chromium extension that modifies websites using your own CSS and JS snippets.
44

5-
Usefull for Developers, you can add Pages for which you can write CSS and JS snippets wich will be injected into them. All of them are custom writen by you on the Options page.
5+
## Version Support
66

7-
Both CSS and JS get inserted only after Page has been fully loaded. They are also inserted only on Pages that match RegExp which you write for them.
7+
Only **v2** is supported and maintained.
88

9-
This extension does not sync with your profile, instead you can export and import your options from the Options page.
9+
The old **v1** Firefox extension is no longer supported.
1010

11-
## Installation
11+
## Browser Compatibility
12+
13+
ModWe v2 targets Chromium-compatible browsers with Manifest V3 support.
14+
15+
It relies on `chrome.userScripts` for user JS execution.
1216

13-
### Firefox (v1.x.x)
17+
Firefox support for v2 is **not provided**.
1418

15-
1. Go [here](https://addons.mozilla.org/en-US/firefox/addon/modwe/) and click Add to Firefox.
19+
## Features
1620

17-
### Chrome (v2.x.x)
21+
- Configure page rules using names, URLs, and RegExp matching.
22+
- Inject custom CSS and JS into matched pages.
23+
- Toggle ModWe quickly from the popup.
24+
- Import and export configuration as JSON.
25+
- Keep all data stored locally in extension storage.
26+
27+
## Installation
1828

19-
1. Go [here](https://github.com/tomaschyly/ModWe/releases) and download latest archive.
20-
2. Unzip somewhere.
21-
3. In your browser go to extensions and with developer mode enabled load unpacked extension.
29+
1. Download the latest release archive from: <https://github.com/tomaschyly/ModWe/releases>
30+
2. Unzip it to a local folder.
31+
3. Open your browser extension page.
32+
4. Enable Developer Mode.
33+
5. Load the unpacked extension folder.
2234

23-
## Important Notes
35+
## Important Requirement
2436

25-
There are no snippets provided with the extensions. You have to write all CSS and JS.
37+
For JS snippets to run, the browser option to allow user scripts for this extension must be enabled.
2638

27-
All the data is stored locally, it is not transmitted online.
39+
If user scripts are disabled, CSS may still apply but JS snippets will not execute.
2840

29-
## How to Use
41+
## Usage
3042

31-
1. Use the toolbar button to open popup.
32-
2. Use the right button to open options.
33-
3. Add Page, write any Name you want as identifier. Url is used from popup for quick navigation. RegExp needs to be valid RegExp (e.g.: /google\.com/), it is used by script to determine correct Page for CSS/JS injection.
34-
4. Use the settings button to open Page settings, here you can write your CSS/JS.
35-
5. In popup make sure to toggle to Enabled.
36-
6. Now when you visit any Page which is valid by your RegExp, CSS/JS will be injected.
43+
1. Open the popup from the toolbar.
44+
2. Open Options from the popup.
45+
3. Add a page entry and provide a valid RegExp (for example: `/google\.com/`).
46+
4. Open page settings and write CSS/JS snippets.
47+
5. Enable ModWe in the popup.
48+
6. Visit a matching page to apply your snippets.

assets/icons/download.svg

Lines changed: 15 additions & 0 deletions
Loading

assets/icons/search.svg

Lines changed: 14 additions & 0 deletions
Loading

assets/icons/settings.svg

Lines changed: 14 additions & 0 deletions
Loading

assets/icons/upload.svg

Lines changed: 15 additions & 0 deletions
Loading

assets/icons/x.svg

Lines changed: 14 additions & 0 deletions
Loading

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "ModWe",
4-
"version": "2.2.0",
4+
"version": "2.3.0",
55
"description": "Modify websites using custom CSS and JS snippets.",
66
"icons": {
77
"48": "icons/ic_dashboard_48dp_1x.png",

options/default.css

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,34 @@ h1 { margin: 0; color: var(--mw-secondary); font-size: 22px; line-height: 1.2; }
3535
h2 { margin: 0 0 16px 0; color: var(--mw-text-primary); font-size: 20px; line-height: 1.2; }
3636
p { margin: 0 0 16px 0; }
3737

38+
.mw-icon {
39+
display: inline-block;
40+
width: 22px;
41+
height: 22px;
42+
background-color: currentColor;
43+
-webkit-mask-repeat: no-repeat;
44+
mask-repeat: no-repeat;
45+
-webkit-mask-position: center;
46+
mask-position: center;
47+
-webkit-mask-size: contain;
48+
mask-size: contain;
49+
}
50+
51+
.mw-icon-upload {
52+
-webkit-mask-image: url("../assets/icons/upload.svg");
53+
mask-image: url("../assets/icons/upload.svg");
54+
}
55+
56+
.mw-icon-download {
57+
-webkit-mask-image: url("../assets/icons/download.svg");
58+
mask-image: url("../assets/icons/download.svg");
59+
}
60+
61+
.mw-icon-x {
62+
-webkit-mask-image: url("../assets/icons/x.svg");
63+
mask-image: url("../assets/icons/x.svg");
64+
}
65+
3866
button {
3967
padding: 4px 8px;
4068
border: 1px solid #ffffff;
@@ -109,7 +137,7 @@ form textarea {
109137
width: 100%;
110138
max-width: none;
111139
height: auto;
112-
padding: 0 0 16px 0;
140+
padding: 56px 0 16px 0;
113141
margin: 0;
114142
}
115143

@@ -129,13 +157,18 @@ form textarea {
129157
.titlebar {
130158
display: flex;
131159
align-items: center;
160+
position: fixed;
161+
top: 0;
162+
left: 0;
163+
right: 0;
164+
z-index: 100;
132165
width: 100%;
133166
max-width: none;
134167
padding: 8px 16px;
135168
border: 0;
136169
border-bottom: 1px solid var(--mw-secondary-dark);
137170
border-radius: 0;
138-
margin: 0 0 16px 0;
171+
margin: 0;
139172
background: var(--mw-primary-dark);
140173
box-shadow: none;
141174
}
@@ -145,7 +178,7 @@ form textarea {
145178
.controls button { display: inline-block; padding: 0; border: 0; margin: 0 0 0 auto; color: var(--mw-text-primary); background: transparent; }
146179
.controls button:hover,
147180
.controls button:focus { color: var(--mw-secondary); background: transparent; }
148-
.controls svg { display: inline-block; width: 22px; height: 22px; }
181+
.controls .mw-icon { width: 22px; height: 22px; }
149182

150183
.import-area { display: none; }
151184

@@ -203,6 +236,13 @@ form textarea {
203236
background: var(--mw-success);
204237
}
205238

239+
#toggle-hint {
240+
margin: -8px 0 16px 0;
241+
color: var(--mw-text-muted);
242+
font-size: 14px;
243+
line-height: 1.35;
244+
}
245+
206246
#page-settings-panel { display: none; }
207247
#page-settings { position: relative; }
208248
#page-settings-panel .controls { position: absolute; top: 0; right: 0; }
@@ -216,7 +256,7 @@ form textarea {
216256
margin-bottom: 16px;
217257
}
218258

219-
#modal { display: none; justify-content: center; position: fixed; left: 0; top: 0; right: 0; transition: top 0.4s linear; }
259+
#modal { display: none; justify-content: center; position: fixed; left: 0; top: 0; right: 0; z-index: 200; pointer-events: none; transition: top 0.4s linear; }
220260
#modal.visible { display: flex; }
221261

222262
#modal .modal-content {
@@ -229,6 +269,8 @@ form textarea {
229269
margin-top: 8px;
230270
background: var(--mw-primary-light);
231271
box-shadow: 0 2px 10px var(--mw-shadow);
272+
pointer-events: auto;
273+
cursor: pointer;
232274
}
233275

234276
#modal .modal-content p { margin-bottom: 8px; color: var(--mw-text-primary); }

options/default.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ <h1>ModWe</h1>
1616

1717
<div class="controls">
1818
<button type="button" id="import" title="Import options">
19-
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="upload" class="svg-inline--fa fa-upload fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"/></svg>
19+
<span class="mw-icon mw-icon-upload" aria-hidden="true"></span>
2020
</button>
2121
<button type="button" id="export" title="Export options">
22-
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="download" class="svg-inline--fa fa-download fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"/></svg>
22+
<span class="mw-icon mw-icon-download" aria-hidden="true"></span>
2323
</button>
2424
</div>
2525
</div>
2626

2727
<div class="panel">
2828
<button type="button" id="toggle-enabled">Disabled</button>
29+
<p id="toggle-hint">
30+
User scripts must be enabled for this extension in browser extension settings, otherwise ModWe will not work.
31+
</p>
2932
</div>
3033

3134
<div class="panel import-area">
@@ -70,7 +73,7 @@ <h2>Page Settings</h2>
7073

7174
<div class="controls">
7275
<button type="button" id="page-settings-close-nosave" title="Close page settings without saving">
73-
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="times" class="svg-inline--fa fa-times fa-w-11" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"/></svg>
76+
<span class="mw-icon mw-icon-x" aria-hidden="true"></span>
7477
</button>
7578
</div>
7679

0 commit comments

Comments
 (0)