Skip to content

Commit 8ea63ad

Browse files
committed
[userscript] add http-redirect-enforcer
1 parent 77b2a7f commit 8ea63ad

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ My user scripts to add functionality to various sites around the web (that were
99
- [GitHub Gist - CodeMirror Resizer](./userscripts/github-gist-codemirror-resizer/) ([Install](https://github.com/0xdevalias/userscripts/raw/main/userscripts/github-gist-codemirror-resizer/github-gist-codemirror-resizer.user.js))
1010
- [GitHub Notifications - Arrow key navigation](./userscripts/github-notifications-arrow-key-navigation/) ([Install](https://github.com/0xdevalias/userscripts/raw/main/userscripts/github-notifications-arrow-key-navigation/github-notifications-arrow-key-navigation.user.js))
1111
- [Google developer sites - Ensure ?authuser= by default](./userscripts/google-developer-sites-ensure-authuser/) ([Install](https://github.com/0xdevalias/userscripts/raw/main/userscripts/google-developer-sites-ensure-authuser/google-developer-sites-ensure-authuser.user.js))
12+
- [HTTP Redirect Enforcer (for specific sites)](./userscripts/http-redirect-enforcer/) ([Install](https://github.com/0xdevalias/userscripts/raw/main/userscripts/http-redirect-enforcer/http-redirect-enforcer.user.js))
1213
- [Nourishd Meal Highlighter](./userscripts/nourishd-meal-highlighter/) ([Install](https://github.com/0xdevalias/userscripts/raw/main/userscripts/nourishd-meal-highlighter/nourishd-meal-highlighter.user.js))
1314
- [YouTube Speed Override](./userscripts/youtube-speed-override/) ([Install](https://github.com/0xdevalias/userscripts/raw/main/userscripts/youtube-speed-override/youtube-speed-override.user.js))
1415

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# HTTP Redirect Enforcer (for specific sites)
2+
3+
```javascript
4+
// ==UserScript==
5+
// @name HTTP Redirect Enforcer (for specific sites)
6+
// @description Ensures the use of HTTP instead of HTTPS on sites that normally redirect via HTTP
7+
// @author Glenn 'devalias' Grant (devalias.net)
8+
// @homepageURL https://github.com/0xdevalias/userscripts
9+
// @supportURL https://github.com/0xdevalias/userscripts/issues
10+
// @downloadURL https://github.com/0xdevalias/userscripts/raw/main/userscripts/http-redirect-enforcer/http-redirect-enforcer.user.js
11+
// @namespace https://www.devalias.net/
12+
// @version 0.1
13+
// @run-at document-start
14+
// @match https://mail.ensquared.net/*
15+
// @match https://mail.devalias.net/*
16+
// @grant none
17+
// ==/UserScript==
18+
```
19+
20+
- [Install](https://github.com/0xdevalias/userscripts/raw/main/userscripts/http-redirect-enforcer/http-redirect-enforcer.user.js)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ==UserScript==
2+
// @name HTTP Redirect Enforcer (for specific sites)
3+
// @description Ensures the use of HTTP instead of HTTPS on sites that normally redirect via HTTP
4+
// @author Glenn 'devalias' Grant (devalias.net)
5+
// @homepageURL https://github.com/0xdevalias/userscripts
6+
// @supportURL https://github.com/0xdevalias/userscripts/issues
7+
// @downloadURL https://github.com/0xdevalias/userscripts/raw/main/userscripts/http-redirect-enforcer/http-redirect-enforcer.user.js
8+
// @namespace https://www.devalias.net/
9+
// @version 0.1
10+
// @run-at document-start
11+
// @match https://mail.ensquared.net/*
12+
// @match https://mail.devalias.net/*
13+
// @grant none
14+
// ==/UserScript==
15+
16+
(function() {
17+
'use strict';
18+
19+
const currentLocation = window.location.href;
20+
21+
if (currentLocation.startsWith('https://')) {
22+
const httpLocation = currentLocation.replace('https://', 'http://');
23+
window.location.href = httpLocation;
24+
}
25+
})();

0 commit comments

Comments
 (0)