Skip to content

Commit

Permalink
Restructured
Browse files Browse the repository at this point in the history
Signed-off-by: Magic <[email protected]>
  • Loading branch information
magicoflolis committed Jun 19, 2022
1 parent c07da2b commit f9ffe59
Show file tree
Hide file tree
Showing 115 changed files with 4,906 additions and 52,229 deletions.
9 changes: 4 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
root = true
charset = utf-8

trim_trailing_whitespace = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/src/header.js
src/header.js
header.js

/tools/userscript.js
tools/userscript.js
userscript.js
32 changes: 32 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"root": true,
"globals": {
"GM": "writable",
"browser": "readonly",
"chrome": "readonly",
"webext": "readonly",
"brws": "readonly"
},
"env": {
"browser": true,
"es2021": true,
"greasemonkey": true,
"jquery": true,
"node": true
},
"extends": [
"eslint:recommended",
"prettier"
],
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": false,
"ecmaFeatures": {
"globalReturn": true,
"arrowFunctions": true,
"modules": true
},
"ecmaVersion": "latest"
},
"rules": {}
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jspm_packages/
.vscode/.history

*.bak
*.code-workspace
*.web-extension-id
web-ext-artifacts
web-ext
Expand Down
11 changes: 11 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"jsc": {
"parser": {
"syntax": "ecmascript"
},
"target": "es2020"
},
"module": {
"type": "es6"
}
}
59 changes: 31 additions & 28 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
{
"version": "0.2.0",
"compounds": [
{
"name": "Attach/Launch",
"configurations": ["Attach:Firefox", "Start:Firefox"]
}
],
"configurations": [
{
"name": "Attach:Firefox",
"type": "firefox",
"request": "attach",
},
"version": "0.2.0",
"compounds": [
{
"name": "Attach/Launch",
"configurations": ["Attach:Firefox", "Start:Firefox"]
}
],
"configurations": [
{
"name": "Attach:Firefox",
"type": "firefox",
"request": "attach",
},
{
"name": "SF",
"type": "firefox",
"request": "launch",
"clearConsoleOnReload": true,
"reAttach": true,
"reloadOnAttach": true,
"keepProfileChanges": false,
"reloadOnChange": "${workspaceFolder}/src/js/**",
"url": "https://www.google.com/",
"addonPath": "${workspaceFolder}\\tests\\firefox",
"pathMappings": [
{
"name": "Start:Firefox",
"type": "firefox",
"request": "launch",
"reAttach": true,
"reloadOnAttach": true,
"keepProfileChanges": false,
"clearConsoleOnReload": true,
"url": "https://www.google.com/",
"addonPath": "${workspaceFolder}\\dist\\extension",
"reloadOnChange": {
"watch": [ "${workspaceFolder}/dist/extension/js/*.js" ],
"ignore": [ "${workspaceFolder}/node_modules/**" ]
"url": "webpack:///js",
"path": "${workspaceFolder}/src/js"
}
}
]
}
]
}
]
}
79 changes: 10 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
# Magic Userscript+

> [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.
*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).*
*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).*

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

***

| Version | Link | Note | Alternative | Build |
|:----------:|:----------:|:----------:|:----------:|:----------:|
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)
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)
Userscript | [Install [GitHub]](https://raw.githubusercontent.com/magicoflolis/Userscript-Plus/master/dist/magic-userjs.user.js) | The userscript **WON'T** work for all websites, [info](#known-bugs). | [Install [Greasy Fork]](https://greasyfork.org/scripts/421603) | [Userscript](#build-setup)
| Version | Link | Alternative | Note |
|:----------:|:----------:|:----------:|:----------:|
Chrome / Edge | - | - | Work in progress
Firefox | - | - | Work in progress
Userscript | [Install (GitHub)](https://github.com/magicoflolis/Userscript-Plus/releases/latest/download/magic-userjs.user.js) | [Greasy Fork](https://greasyfork.org/scripts/421603) | -

***

## Features

**_Optional_** *install [Greasyfork Search with Sleazyfork Results include](https://greasyfork.org/scripts/23840).*

> 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!
* Tested and compatible with TamperMonkey n ViolentMonkey.
* Trimmed / moved some @resources to this build.
* Added [SleazyFork](https://sleazyfork.org).
Expand All @@ -44,64 +40,9 @@ let sleazyfork_redirect = false; // "true" to enable, "false" to disable

> **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.
## Manual Install

Chromium

* Download and unzip [latest release](https://github.com/magicoflolis/Userscript-Plus/releases) into desired folder.
* Go to chromium/chrome *Extensions*.
* Click to check *Developer mode*.
* Click *Load unpacked extension...*.
* In the file selector dialog:
* Select the directory `userscript_for_tampermonkey-*` / desired folder.
* Click *Open*.

Firefox

> See: [Temporary installation in Firefox](https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox)
* Download and unzip [latest release](https://github.com/magicoflolis/Userscript-Plus/releases) into desired folder.
* Copy and paste `about:debugging#/runtime/this-firefox` into your URL.
* Click *Load Temporary Add-on…*.
* In the file selector dialog:
* Select the directory `userscript_for_tampermonkey-*` / desired folder.
* Click *Open*.

## Build Setup

> Developed using [VSCodium](https://vscodium.com).
| Help Links |
|:----------:|
[web-ext documentation](https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/) |
[http-server](https://github.com/http-party/http-server) |
[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) |

```bash
# Install dependencies ( if error use npm i --force )
npm i
# [ Production ] Builds both User Script and Browser Extension
npm run build:all
# [ Development ] User Script
# Recommend bookmarking for faster deployment
# http://localhost:8080/magic-userjs.user.js
npm run dev:user
npm run http-server
# [ Development ] Browser Extension
# For Firefox use web-ext
# Recommended to create additional profile about:profiles
web-ext run -p <profile>
npm run dev:browser
# For Chrome load unpacked, REPLACE manifest.json with chrome-manifest.json
```

## Source Code

* [GitHub](https://github.com/magicoflolis/Userscript-Plus)

### License

MIT
* [GitHub](https://github.com/magicoflolis/Userscript-Plus/src)

### Contacts

Expand Down
38 changes: 38 additions & 0 deletions Userscript-Plus.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"search.exclude": {
"**/node_modules": true,
"**/chrome_dist/js": true,
"**/dist/js": true
},
"editor.formatOnSaveMode": "modifications",
"files.trimTrailingWhitespace": true,
"files.associations": {
".eslintrc": "jsonc"
},
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.fixAll.eslint": true
},
"local-history.daysLimit": 7,
"local-history.maxDisplay": 10,
"local-history.saveDelay": 0,
"local-history.dateLocale": "en-US",
"local-history.exclude": [
"**/.history/**",
"**/.vscode/**",
"**/node_modules/**",
"**/dist/**",
"**/chrome_dist/**",
"**/build/**",
"**/*.code-workspace",
"**/src/sass/**",
],
"local-history.path": "${workspaceFolder}/.vscode",
}
}
4 changes: 2 additions & 2 deletions dist/extension/background.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>MagicUserJS</title>
</head>
<body>
<script src="./js/psl.min.js"></script>
<script src="./js/background.js"></script>
<script src="js/psl.min.js"></script>
<script src="js/background.js"></script>
</body>
</html>
Loading

0 comments on commit f9ffe59

Please sign in to comment.