diff --git a/src/main/Main.coffee b/src/main/Main.coffee index 1f820327a..6007b719a 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -67,10 +67,7 @@ Main = Conf['cooldowns'] = {} Conf['Index Sort'] = {} Conf["Last Long Reply Thresholds #{i}"] = {} for i in [0...2] - Conf['siteProperties'] = - '4chan.org': {software: 'yotsuba'} - '4channel.org': {software: 'yotsuba'} - '4cdn.org': {software: 'yotsuba'} + Conf['siteProperties'] = {} # XXX old key names Conf['Except Archives from Encryption'] = false @@ -80,11 +77,7 @@ Main = Conf['QR Shortcut'] = true Conf['Bottom QR Link'] = true Conf['Toggleable Thread Watcher'] = true - Conf['siteSoftware'] = """ - 4chan.org yotsuba - 4channel.org yotsuba - 4cdn.org yotsuba - """ + Conf['siteSoftware'] = '' # Enforce JS whitelist if /\.4chan(?:nel)?\.org$/.test(location.hostname) and !$$('script:not([src])', d).filter((s) -> /this\[/.test(s.textContent)).length diff --git a/src/site/Site.coffee b/src/site/Site.coffee index b33658864..4e2f0edea 100644 --- a/src/site/Site.coffee +++ b/src/site/Site.coffee @@ -1,5 +1,11 @@ Site = + defaultProperties: + '4chan.org': {software: 'yotsuba'} + '4channel.org': {software: 'yotsuba'} + '4cdn.org': {software: 'yotsuba'} + init: (cb) -> + $.extend Conf['siteProperties'], Site.defaultProperties {hostname} = location while hostname and hostname not of Conf['siteProperties'] hostname = hostname.replace(/^[^.]*\.?/, '')