fix(init): add defensive error handling for edge cases
Added comprehensive error handling to prevent extension initialization failures: - Added settings validation in loadSettings() to detect corrupt data - Improved error recovery in main initialization with granular try-catch blocks - Enhanced HTML regex import with structure validation and detailed error logging - Added detection for conflicting old manual formatting regex scripts - Added user-friendly toastr notifications for initialization errors and conflicts - Each init step now has independent error handling to prevent cascade failures This fixes issues where invalid extension_settings could prevent the extension from loading entirely. The extension will now gracefully handle corrupt data, warn about conflicts, and fall back to defaults when necessary. Related to user report where extension wouldn't load with certain settings.json configurations containing old manual formatting regexes or malformed data.
This commit is contained in:
@@ -2866,7 +2866,7 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
||||
background: var(--rpg-highlight, #e94560);
|
||||
color: white;
|
||||
border: 2px solid var(--rpg-bg, rgba(30, 30, 50, 0.95));
|
||||
font-size: 1.7vw;
|
||||
font-size: clamp(0.9rem, 1rem, 1.1rem);
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
@@ -2894,7 +2894,7 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1.85vw;
|
||||
font-size: clamp(1.3rem, 1.4rem, 1.5rem);
|
||||
cursor: pointer;
|
||||
animation: thoughtIconPulse 2s ease-in-out infinite;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
|
||||
@@ -3016,7 +3016,7 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
||||
/* Thought content on the right */
|
||||
.rpg-thought-content {
|
||||
flex: 1;
|
||||
font-size: clamp(0.68vw, 0.7vw, 0.72vw);
|
||||
font-size: clamp(0.85rem, 0.9rem, 0.95rem);
|
||||
line-height: 1.5;
|
||||
color: var(--rpg-text, #eaeaea);
|
||||
font-style: italic;
|
||||
|
||||
Reference in New Issue
Block a user