From 673a3e08d2ac2eea44b13aee3d41a4a5571be9cd Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 19 Sep 2012 03:48:08 +0200 Subject: [PATCH] Don't reset all of 4chan's settings, just disable it. --- 4chan_x.user.js | 6 ++++-- script.coffee | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 69b00c320..55029e307 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -5003,7 +5003,7 @@ Main = { init: function() { - var cutoff, hiddenThreads, id, key, now, path, pathname, temp, timestamp, val, _ref; + var cutoff, hiddenThreads, id, key, now, path, pathname, settings, temp, timestamp, val, _ref; Main.flatten(null, Config); path = location.pathname; pathname = path.slice(1).split('/'); @@ -5054,7 +5054,9 @@ return; } if (Conf['Disable 4chan\'s extension']) { - localStorage.setItem('4chan-settings', '{"disableAll":true}'); + settings = JSON.parse(localStorage.getItem('4chan-settings')) || {}; + settings.disableAll = true; + localStorage.setItem('4chan-settings', JSON.stringify(settings)); } Options.init(); if (Conf['Quick Reply'] && Conf['Hide Original Post Form']) { diff --git a/script.coffee b/script.coffee index 07215f8f4..48d0a0a33 100644 --- a/script.coffee +++ b/script.coffee @@ -4037,7 +4037,9 @@ Main = return if Conf['Disable 4chan\'s extension'] - localStorage.setItem '4chan-settings', '{"disableAll":true}' + settings = JSON.parse(localStorage.getItem '4chan-settings') or {} + settings.disableAll = true + localStorage.setItem '4chan-settings', JSON.stringify settings Options.init()