// ==UserScript==
// @name Auto-set Mangadex Reader localStorage Settings
// @namespace
http://mangadex.org
// @version 0.1
// @description Auto-set MD reader settings to user preferred settings
// @author You
// @match https://*.mangadex.org/*
// @icon
https://www.google.com/s2/favicons?domain=mangadex.org
// @run-at document-start
// @grant none
// ==/UserScript==
(function () {
'use strict';
// Replace reader_settings with your own settings
// Navigate to browser Dev Tools and the Application/Storage tab and look for Local Storage
// Find the "md" Key and copy the Value contents to the 'localStorageSettings' varable below
// You can also use a json formatter to make things neater.
// Example json formatter site:
https://jsonformatter.org
let localStorageSettings = {
"readerMenu": {
"readStyle": 1,
"headerStyle": 0,
"_viewStyle": 1,
"_limitWidth": true,
"_limitHeight": true,
"_scrollLock": {
"width": true,
"height": true,
"none": true
},
"_longStripMargin": 4,
"maxWidth": -1,
"maxHeight": -1,
"limitMaxWidth": false,
"limitMaxHeight": false,
"dimPages": false,
"dimWithDark": false,
"pageDim": 0.2,
"progressHeight": 12,
"progressMode": 2,
"progressSide": 1,
"backgroundColor": "transparent",
"cursorHints": 0,
"doAutoAdvance": true,
"_growPages": true,
"historyMode": 1,
"immersiveTap": true,
"keys": {
"toggleMenu": [
"KeyM",
"NumpadDecimal:0"
],
"pageForward": [
"ArrowRight",
"Numpad6"
],
"pageBackward": [
"ArrowLeft",
"Numpad4"
],
"chapterForward": [
"Period",
null
],
"chapterBackward": [
"Comma",
null
],
"immersiveMode": [
"KeyF",
null
],
"offsetSpread": [
"KeyO",
"KeyQ"
]
},
"lockOffset": 0,
"showPageNumber": false,
"turnPages": 0,
"turnPagesByScrolling": 0,
"hasImmersiveBefore": true,
"_showMenuButton": true,
"menuOpen": true,
"menuPinned": true,
"offsetDoubles": {}
},
"userPreferences": {
"filteredLanguages": [
"en"
],
"originLanguages": [
"ja"
],
"paginationCount": 48,
"listMultiplier": 3,
"showSafe": true,
"showErotic": true,
"showSuggestive": true,
"showHentai": false,
"theme": "light",
"mdahPort443": false,
"dataSaver": false,
"groupBlacklist": [],
"userBlacklist": [],
"locale": "en"
},
"metadata": {
"version": 0,
"modified": 1675626044243
},
"preferredLayout": {
"listStyle": 1,
"listStyleNoArt": 1,
"feedStyle": 1,
"oneLine": true,
"bottomNavPadding": 0,
"ambient": true
},
"announcements": {
"hidden": [
"sus"
]
},
"readingHistory": {
"_readingHistory": []
}
}
// update localStorage with preferred reader settings if md item doesn't exist
if (!localStorage.getItem('md')){
localStorage.setItem('md', JSON.stringify(localStorageSettings));
}
})();