Skip to content

Commit 3a9dba6

Browse files
committed
Updated UserJS to v7.6.9
Signed-off-by: Magic <magicoflolis@tuta.io>
1 parent 713276d commit 3a9dba6

3 files changed

Lines changed: 28 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<center><h1>2026-08-09: update your "Search Engines" (if already installed):</h1></center>
1+
<center><h1>2026-08-09: Manually edit "Search Engines" if updating to v7.6.9:</h1></center>
22
<div><b>OLD: </b><code>https://greasyfork.org/scripts/by-site/{host}.json?language=all</code> <b>NEW: </b><code>https://api.greasyfork.org/scripts/by-site/{host}.json?language=all</code></div>
33
<div><b>OLD: </b><code>https://sleazyfork.org/scripts/by-site/{host}.json?language=all</code> <b>NEW: </b><code>https://api.sleazyfork.org/scripts/by-site/{host}.json?language=all</code></div>
44
<i>Don't forget to click "Save" after!</i>

dist/magic-userjs.meta.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/magic-userjs.user.js

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ==UserScript==
2-
// @version 7.6.8
2+
// @version 7.6.9
33
// @name Magic Userscript+ : Show Site All UserJS
44
// @name:ar Magic Userscript+: عرض جميع ملفات UserJS
55
// @name:de Magic Userscript+ : Website anzeigen Alle UserJS
@@ -88,14 +88,6 @@ if (
8888
console.error('[%cMagic Userscript+%c] %cERROR','color: rgb(29, 155, 240);','','color: rgb(249, 24, 128);', `MIME type is not a document, got "${document.contentType || ''}"`);
8989
}
9090
if (!(typeof userjs === 'object' && userjs.UserJS)) return;
91-
{
92-
/** Native implementation exists */
93-
const excludePolicy = [
94-
'outlook.office.com'
95-
];
96-
const hostname = location?.hostname || '';
97-
if (window.trustedTypes && window.trustedTypes.createPolicy && !hostname.includes(excludePolicy)) window.trustedTypes.createPolicy('default', { createHTML: (string) => string, createScript: (string) => string, createScriptURL: (string) => string });
98-
}
9991
/** [i18n directory](https://github.com/magicoflolis/Userscript-Plus/tree/master/src/_locales) */
10092
const translations = {
10193
'ar': {
@@ -2075,12 +2067,12 @@ const DEFAULT_CONFIG = {
20752067
{
20762068
enabled: true,
20772069
name: 'greasyfork',
2078-
query: encodeURIComponent('https://greasyfork.org/scripts/by-site/{host}.json?language=all')
2070+
query: encodeURIComponent('https://api.greasyfork.org/scripts/by-site/{host}.json?language=all')
20792071
},
20802072
{
20812073
enabled: false,
20822074
name: 'sleazyfork',
2083-
query: encodeURIComponent('https://sleazyfork.org/scripts/by-site/{host}.json?language=all')
2075+
query: encodeURIComponent('https://api.sleazyfork.org/scripts/by-site/{host}.json?language=all')
20842076
},
20852077
{
20862078
enabled: false,
@@ -5913,6 +5905,29 @@ const loadDOM = (onDomReady) => {
59135905
};
59145906

59155907
const init = async (prefix = 'Config') => {
5908+
if (typeof window === 'undefined') {
5909+
return;
5910+
}
5911+
if (typeof window.trustedTypes !== 'undefined') {
5912+
/**
5913+
* Delay `trustedTypes.createPolicy` creation
5914+
*/
5915+
const toDelay = [
5916+
/** Microsoft Outlook */
5917+
'outlook'
5918+
].join('|');
5919+
const delayReg = new RegExp(toDelay, 'gi');
5920+
if (delayReg.test(url.hostname)) {
5921+
await new Promise((resolve) => _self.setTimeout(resolve, 1000));
5922+
}
5923+
if (isNull(window.trustedTypes.defaultPolicy)) {
5924+
window.trustedTypes.createPolicy('default', {
5925+
createHTML: (string) => string,
5926+
createScript: (string) => string,
5927+
createScriptURL: (string) => string
5928+
});
5929+
}
5930+
}
59165931
const stored = await StorageSystem.getValue(prefix, DEFAULT_CONFIG);
59175932
cfg = {
59185933
...DEFAULT_CONFIG,

0 commit comments

Comments
 (0)