Skip to content

Commit 7301925

Browse files
committed
2.4.13
Signed-off-by: Magic <magicoflolis@tuta.io>
1 parent f9ffe59 commit 7301925

14 files changed

Lines changed: 123 additions & 216 deletions

File tree

README.gf.md

Lines changed: 17 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,52 @@
11
# Magic Userscript+
22

3-
> [09/09/21] Greasy Fork version may not work due to userscript library being removed. Use [GitHub](https://raw.githubusercontent.com/magicoflolis/Userscript-Plus/master/dist/magic-userjs.user.js) version for now.
4-
5-
*Fork of [Userscript+ : Show Site All UserJS](https://greasyfork.org/scripts/24508-userscript-show-site-all-userjs). Source code & authors information found [here](https://github.com/jae-jae/Userscript-Plus#userscript).*
3+
*Fork of [Userscript+ : Show Site All UserJS](https://github.com/jae-jae/Userscript-Plus#userscript). Source code & authors information found [here](https://github.com/jae-jae/Userscript-Plus).*
64

75
> Finds available UserJS for current site.
86
9-
![Preview](https://raw.githubusercontent.com/magicoflolis/Userscript-Plus/master/resources/preview.png)
7+
| Preview(s) |
8+
|:----------:|
9+
![Preview](https://raw.githubusercontent.com/magicoflolis/Userscript-Plus/master/resources/preview.png)|
1010

1111
***
1212

13-
| Version | Link | Note | Alternative | Build |
14-
|:----------:|:----------:|:----------:|:----------:|:----------:|
15-
Chrome | ~~Install [Chrome Web Store]~~ | **There are no excluded websites, use at your own risk.** *Must be installed [manually](#manual-install).* | [Install [GitHub]](https://github.com/magicoflolis/Userscript-Plus/releases) | [Extension](#build-setup)
16-
Firefox | [Install [Firefox Add-ons]](https://addons.mozilla.org/addon/userscript-plus) | **There are no excluded websites, use at your own risk.** *Can be installed [manually](#manual-install).* | [Install [GitHub]](https://github.com/magicoflolis/Userscript-Plus/releases) | [Add-on](#build-setup)
17-
Userscript | [Install](#install-area) | The userscript **WON'T** work for all websites, [info](#known-bugs). | [Install [GitHub]](https://raw.githubusercontent.com/magicoflolis/Userscript-Plus/master/dist/magic-userjs.user.js) | [Userscript](#build-setup)
13+
| Version | Link | Alternative | Note |
14+
|:----------:|:----------:|:----------:|:----------:|
15+
Chrome / Edge | - | - | Work in progress
16+
Firefox | - | - | Work in progress
17+
Userscript | [Greasy Fork](https://greasyfork.org/scripts/421603) | [Install (GitHub)](https://github.com/magicoflolis/Userscript-Plus/releases/latest/download/magic-userjs.user.js) | -
1818

1919
***
2020

2121
## Features
2222

23-
**_Optional_** *install [Greasyfork Search with Sleazyfork Results include](https://greasyfork.org/scripts/23840).*
24-
25-
> Currently [Userscript+](https://github.com/jae-jae/Userscript-Plus#userscript) can only find userscripts through __GreasyFork__, I've added support for __SleazyFork__ along with a few additional features and tweaks!
26-
2723
* Tested and compatible with TamperMonkey n ViolentMonkey.
2824
* Trimmed / moved some @resources to this build.
2925
* Added [SleazyFork](https://sleazyfork.org).
3026
* Added Dark Theme.
3127
* Added extra @excludes.
3228
* Added built-in [Greasyfork Search with Sleazyfork Results include](https://greasyfork.org/scripts/23840).
29+
* Added ability to customize width.
3330

34-
```bash
35-
let sleazyfork_redirect = false; // "true" to enable, "false" to disable
31+
```JS
32+
const sleazyfork_redirect = false, // 'true' to enable, 'false' to disable
33+
custom_width = '', // Default UserJS width: 90vw | Original UserJS width: 860px
34+
...
3635
```
3736

3837
## Known bugs
3938

40-
* [ User Script ] *May* conflict with a few running user scripts. (Example: [Twitter External Translator](https://greasyfork.org/scripts/421643))
39+
* [ Chinese ] List may not display properly.
40+
* [ User Script ] *May* conflict with any UserJS that runs in iframes.
4141
* [ All ] May leave a opened tab when installing user scripts.
4242
* [ User Script ] Found count may not appear.
4343
* [ User Script ] In some sites below the plug-in interface icon is not displayed
4444

4545
> **Reason**:This is because the security policy of these sites to prevent the plug-in icon font file loading, resulting in the icon does not display properly.
4646
47-
## Manual Install
48-
49-
Chromium
50-
51-
* Download and unzip [latest release](https://github.com/magicoflolis/Userscript-Plus/releases) into desired folder.
52-
* Go to chromium/chrome *Extensions*.
53-
* Click to check *Developer mode*.
54-
* Click *Load unpacked extension...*.
55-
* In the file selector dialog:
56-
* Select the directory `userscript_for_tampermonkey-*` / desired folder.
57-
* Click *Open*.
58-
59-
Firefox
60-
61-
> See: [Temporary installation in Firefox](https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox)
62-
63-
* Download and unzip [latest release](https://github.com/magicoflolis/Userscript-Plus/releases) into desired folder.
64-
* Copy and paste `about:debugging#/runtime/this-firefox` into your URL.
65-
* Click *Load Temporary Add-on…*.
66-
* In the file selector dialog:
67-
* Select the directory `userscript_for_tampermonkey-*` / desired folder.
68-
* Click *Open*.
69-
70-
## Build Setup
71-
72-
> Developed using [VSCodium](https://vscodium.com).
73-
74-
| Help Links |
75-
|:----------:|
76-
[web-ext documentation](https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/) |
77-
[http-server](https://github.com/http-party/http-server) |
78-
[How to edit scripts with your favorite editor?](https://violentmonkey.github.io/posts/how-to-edit-scripts-with-your-favorite-editor/#install-a-local-script) |
79-
80-
```bash
81-
# Install dependencies ( if error use npm i --force )
82-
npm i
83-
# [ Production ] Builds both User Script and Browser Extension
84-
npm run build:all
85-
# [ Development ] User Script
86-
# Recommend bookmarking for faster deployment
87-
# http://localhost:8080/magic-userjs.user.js
88-
npm run dev:user
89-
npm run http-server
90-
# [ Development ] Browser Extension
91-
# For Firefox use web-ext
92-
# Recommended to create additional profile about:profiles
93-
web-ext run -p <profile>
94-
npm run dev:browser
95-
# For Chrome load unpacked, REPLACE manifest.json with chrome-manifest.json
96-
```
97-
9847
## Source Code
9948

100-
* [GitHub](https://github.com/magicoflolis/Userscript-Plus)
101-
102-
### License
103-
104-
MIT
49+
* [https://github.com/magicoflolis/Userscript-Plus/tree/master/src](https://github.com/magicoflolis/Userscript-Plus/tree/master/src)
10550

10651
### Contacts
10752

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
|:----------:|:----------:|:----------:|:----------:|
1515
Chrome / Edge | - | - | Work in progress
1616
Firefox | - | - | Work in progress
17-
Userscript | [Install (GitHub)](https://github.com/magicoflolis/Userscript-Plus/releases/latest/download/magic-userjs.user.js) | [Greasy Fork](https://greasyfork.org/scripts/421603) | -
17+
Userscript | [Greasy Fork](https://greasyfork.org/scripts/421603) | [Install (GitHub)](https://github.com/magicoflolis/Userscript-Plus/releases/latest/download/magic-userjs.user.js) | -
1818

1919
***
2020

@@ -26,14 +26,18 @@ Userscript | [Install (GitHub)](https://github.com/magicoflolis/Userscript-Plus/
2626
* Added Dark Theme.
2727
* Added extra @excludes.
2828
* Added built-in [Greasyfork Search with Sleazyfork Results include](https://greasyfork.org/scripts/23840).
29+
* Added ability to customize width.
2930

30-
```bash
31-
let sleazyfork_redirect = false; // "true" to enable, "false" to disable
31+
```JS
32+
const sleazyfork_redirect = false, // 'true' to enable, 'false' to disable
33+
custom_width = '', // Default UserJS width: 90vw | Original UserJS width: 860px
34+
...
3235
```
3336

3437
## Known bugs
3538

36-
* [ User Script ] *May* conflict with a few running user scripts. (Example: [Twitter External Translator](https://greasyfork.org/scripts/421643))
39+
* [ Chinese ] List may not display properly.
40+
* [ User Script ] *May* conflict with any UserJS that runs in iframes.
3741
* [ All ] May leave a opened tab when installing user scripts.
3842
* [ User Script ] Found count may not appear.
3943
* [ User Script ] In some sites below the plug-in interface icon is not displayed
@@ -42,7 +46,7 @@ let sleazyfork_redirect = false; // "true" to enable, "false" to disable
4246
4347
## Source Code
4448

45-
* [GitHub](https://github.com/magicoflolis/Userscript-Plus/src)
49+
* [https://github.com/magicoflolis/Userscript-Plus/tree/master/src](https://github.com/magicoflolis/Userscript-Plus/tree/master/src)
4650

4751
### Contacts
4852

src/js/api.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ export const us = {
1212
elm.addEventListener("touchstart", callback);
1313
elm.addEventListener("touchend", callback);
1414
}
15-
} else {
16-
return elm.addEventListener(event, callback);
17-
}
15+
};
16+
return elm.addEventListener(event, callback);
1817
},
1918
/** Waits until args return true */
2019
async check(args) {
@@ -30,13 +29,8 @@ export const us = {
3029
if(attrs) {
3130
for (let key in attrs) {
3231
el[key] = attrs[key];
33-
// // keys
34-
// alert( key ); // name, age, isAdmin
35-
// // values for the keys
36-
// alert( attrs[key] ); // John, 30, true
3732
}
3833
}
39-
4034
return el;
4135
},
4236
delay(ms) {

src/js/start.js

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,15 @@ import { format } from "timeago.js";
88
import psl from "psl";
99

1010
let config = {
11-
api: "https://greasyfork.org/scripts/by-site/{host}.json",
12-
sapi: "https://sleazyfork.org/scripts/by-site/{host}.json"
11+
api: 'https://greasyfork.org/scripts/by-site/{host}.json',
12+
sapi: 'https://sleazyfork.org/scripts/by-site/{host}.json'
1313
},
1414
cfg,
1515
brws = (typeof browser=="undefined"?chrome:browser),
1616
msg = brws.runtime.connect({name:"messenger"});
17-
1817
msg.onMessage.addListener((m) => {
1918
cfg = m.cfg;
2019
us.log(cfg);
21-
// us.fetchURL(`https://greasyfork.org/scripts/by-site/${location.hostname}.json`).then(json => {
22-
// json = json.map(item => {
23-
// item.user = item.users[0];
24-
// return item;
25-
// });
26-
// sessionStorage.setItem(host, JSON.stringify(json));
27-
// callback(json);
28-
// })
29-
// us.ael(win,"load",loadConfig);
3020
});
3121

3222
const Tools = {
@@ -101,7 +91,7 @@ const Tools = {
10191
this.host.then(host => {
10292
let data = bgSessionStorage.getItem(host),
10393
fetchJS = (url) => {
104-
let f = fetch(url).then(r => r.json())
94+
let f = fetch(url).then(r => r.json());
10595
f.then(json => {
10696
json = json.map(item => {
10797
item.user = item.users[0];
@@ -178,18 +168,6 @@ Tools.getData((json) => {
178168
originData = json,
179169
count = data.length;
180170
for (let d of data) {
181-
// let container = us.create("div","container"),
182-
// arrow = us.create("div","up-arrow"),
183-
// order = us.create("div","up-order"),
184-
// title = us.create("div","up-title"),
185-
// author = us.create("div","up-author"),
186-
// daily = us.create("div","up-daily"),
187-
// updated = us.create("div","up-updated"),
188-
// version = us.create("div","up-version"),
189-
// rating = us.create("div","up-raing"),
190-
// desc = us.create("div","up-desc"),
191-
// installs = us.create("div","up-installs"),
192-
// install = us.create("div","up-install");
193171
itemID+=1;
194172
let row = us.create("tr","ivu-table-row", {
195173
innerHTML: `<td class="">

src/sass/main.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
span {
2525
background-color: #2e323d;
2626
color: #fff;
27-
width: -webkit-fit-content;
28-
width: -moz-fit-content;
2927
width: fit-content;
3028
display: block;
3129
padding: 1rem;

src/sass/options.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ body.userjs-options {
4444
.switch {
4545
position: relative;
4646
width: 38px;
47-
-webkit-user-select: none;
48-
-moz-user-select: none;
49-
-ms-user-select: none;
50-
user-select: none;
47+
user-select: none;
5148
input {
5249
display: none;
5350
&:checked+label {

0 commit comments

Comments
 (0)