diff options
Diffstat (limited to 'src/config.ts')
-rw-r--r-- | src/config.ts | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/config.ts b/src/config.ts index 7ce24123..550f15f4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -479,4 +479,26 @@ const localDefaults = { }; const Config = new ConfigClass(syncDefaults, localDefaults, migrateOldSyncFormats); -export default Config;
\ No newline at end of file +export default Config; + +export function generateDebugDetails(): string { + // Build output debug information object + const output = { + debug: { + userAgent: navigator.userAgent, + platform: navigator.platform, + language: navigator.language, + extensionVersion: chrome.runtime.getManifest().version + }, + config: JSON.parse(JSON.stringify(Config.cachedSyncConfig)) // Deep clone config object + }; + + // Sanitise sensitive user config values + delete output.config.userID; + output.config.serverAddress = (output.config.serverAddress === CompileConfig.serverAddress) + ? "Default server address" : "Custom server address"; + output.config.invidiousInstances = output.config.invidiousInstances.length; + output.config.whitelistedChannels = output.config.whitelistedChannels.length; + + return JSON.stringify(output, null, 4); +}
\ No newline at end of file |