Conversation
Problem When the addShield shortcut was registered with shortcutKeys: "A+83" or "ALT+S", if that key combination was already claimed by another script or WME feature, sdk.Shortcuts.createShortcut would throw an InvalidStateError. This exception was unhandled, causing setupOptions to abort silently — leaving layers, event listeners, and UI elements uninitialized. Fix Wrapped the createShortcut call in a try/catch with a two-stage fallback: First attempt — registers the shortcut with the default A+S key binding as before. On "already in use" error — retries with shortcutKeys: null, registering the shortcut without a key binding. The user can assign a conflict-free key manually via WME's keyboard shortcuts panel. Any other error — logged to console with the RSA: prefix and does not interrupt script initialization.
Waze wrap remote
Restore turf.
- Refactored shortcut registration to use areShortcutKeysInUse() guard instead of catch block error handling - Removed deprecated WazeWrap.Remote server synchronization code (serverSettings, serverSave) - Migrated from Google Sheets REST API to Visualization API (/gviz/tq) to bypass 403 referrer restrictions - Switched from native fetch() to GM_xmlhttpRequest() for proper Tampermonkey sandbox support - Added @connect docs.google.com permission for cross-origin requests - Implemented response caching to prevent duplicate Google Sheets requests - Fixed race condition in isStreetCandidate by making function async and awaiting data loads - Fixed Google Sheets response format parsing (regex pattern and shield ID mapping) - Fixed "Cannot use 'in' operator" error by guarding RoadAbbr[countryId] type checks - Parallelized state abbreviation loading with Promise.allSettled() for better performance - Implemented lazy-loading of state-specific abbreviation data for instant startup (only loads default sheet initially, state sheets load on-demand) - Improved shield direction label styling: white text with black outline, increased font size for better readability
- Refactored shortcut registration to use areShortcutKeysInUse() guard instead of catch block error handling - Removed deprecated WazeWrap.Remote server synchronization code (serverSettings, serverSave) - Migrated from Google Sheets REST API to Visualization API (/gviz/tq) to bypass 403 referrer restrictions - Switched from native fetch() to GM_xmlhttpRequest() for proper Tampermonkey sandbox support - Added @connect docs.google.com permission for cross-origin requests - Implemented response caching to prevent duplicate Google Sheets requests - Fixed race condition in isStreetCandidate by making function async and awaiting data loads - Fixed Google Sheets response format parsing (regex pattern and shield ID mapping) - Fixed "Cannot use 'in' operator" error by guarding RoadAbbr[countryId] type checks - Parallelized state abbreviation loading with Promise.allSettled() for better performance - Implemented lazy-loading of state-specific abbreviation data for instant startup (only loads default sheet initially, state sheets load on-demand) - Improved shield direction label styling: white text with black outline, increased font size for better readability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the addShield shortcut was registered with shortcutKeys: "A+83" or "ALT+S", if that key combination was already claimed by another script or WME feature, sdk.Shortcuts.createShortcut would throw an InvalidStateError. This exception was unhandled, causing setupOptions to abort silently — leaving layers, event listeners, and UI elements uninitialized.
Fix
Wrapped the createShortcut call in a try/catch with a two-stage fallback: