diff --git a/4chan_x.user.js b/4chan_x.user.js index fd5d87c78..202d8f359 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -86,6 +86,7 @@ Config = { main: { Enhancing: { + 'Disable 4chan\'s extension': [true, 'Avoid conflicts between 4chan X and 4chan\'s inline extension.'], '404 Redirect': [true, 'Redirect dead threads and images'], 'Keybinds': [true, 'Binds actions to keys'], 'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'], @@ -2541,16 +2542,6 @@ Options = { init: function() { - if (!$.get('firstrun')) { - $.set('firstrun', true); - localStorage.setItem('4chan-settings', '{"disableAll":true}'); - $.ready(function() { - if (!Favicon.el) { - Favicon.init(); - } - return Options.dialog(); - }); - } return $.ready(Options.initReady); }, initReady: function() { @@ -2566,6 +2557,13 @@ $.on(a, 'click', Options.dialog); $.prepend($.id(settings), [$.tn('['), a, $.tn('] ')]); } + if (!$.get('firstrun')) { + $.set('firstrun', true); + if (!Favicon.el) { + Favicon.init(); + } + return Options.dialog(); + } }, dialog: function() { var arr, back, checked, description, dialog, favicon, fileInfo, filter, hiddenNum, hiddenThreads, indicator, indicators, input, key, li, obj, overlay, sauce, time, tr, ul, _i, _len, _ref, _ref1, _ref2; @@ -5025,6 +5023,9 @@ }); return; } + if (Conf['Disable 4chan\'s extension']) { + localStorage.setItem('4chan-settings', '{"disableAll":true}'); + } Options.init(); if (Conf['Quick Reply'] && Conf['Hide Original Post Form']) { Main.css += '#postForm { display: none; }'; diff --git a/changelog b/changelog index bbc1a638f..94bc2acf4 100644 --- a/changelog +++ b/changelog @@ -6,6 +6,7 @@ master - Quote Previewing. - Thread Expansion. - Comment Expansion. + Add an option to disable 4chan's inline extension. Enabled by default. Fix compatibility with Scriptish's auto-udpater. 2.34.10 diff --git a/script.coffee b/script.coffee index 7a8dbe321..bb4bff7ed 100644 --- a/script.coffee +++ b/script.coffee @@ -1,6 +1,7 @@ Config = main: Enhancing: + 'Disable 4chan\'s extension': [true, 'Avoid conflicts between 4chan X and 4chan\'s inline extension.'] '404 Redirect': [true, 'Redirect dead threads and images'] 'Keybinds': [true, 'Binds actions to keys'] 'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'] @@ -1989,13 +1990,6 @@ QR = Options = init: -> - unless $.get 'firstrun' - $.set 'firstrun', true - localStorage.setItem '4chan-settings', '{"disableAll":true}' - $.ready -> - # Prevent race conditions - Favicon.init() unless Favicon.el - Options.dialog() $.ready Options.initReady initReady: -> for settings in ['navtopright', 'navbotright'] @@ -2005,7 +1999,11 @@ Options = textContent: '4chan X Settings' $.on a, 'click', Options.dialog $.prepend $.id(settings), [$.tn('['), a, $.tn('] ')] - return + unless $.get 'firstrun' + $.set 'firstrun', true + # Prevent race conditions + Favicon.init() unless Favicon.el + Options.dialog() dialog: -> dialog = $.el 'div' @@ -4011,6 +4009,9 @@ Main = location.href = url if url return + if Conf['Disable 4chan\'s extension'] + localStorage.setItem '4chan-settings', '{"disableAll":true}' + Options.init() if Conf['Quick Reply'] and Conf['Hide Original Post Form']