diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 5c22ef7e2..820711acc 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -11983,10 +11983,10 @@ return; } Navigate.updateTitle(board); - _ref = board.ws_board ? [(d.cookie.match(/ws\_style\=[^;]+/) || ['Yotsuba B New'])[0], 'ws_style'] : [(d.cookie.match(/nws\_style\=[^;]+/) || ['Yotsuba New'])[0], 'nws_style'], style = _ref[0], type = _ref[1]; + _ref = board.ws_board ? [(d.cookie.match(/ws\_style\=([^;]+)/) || ['', 'Yotsuba B New'])[1], 'ws_style'] : [(d.cookie.match(/nws\_style\=([^;]+)/) || ['', 'Yotsuba New'])[1], 'nws_style'], style = _ref[0], type = _ref[1]; $.globalEval("var style_group = '" + type + "'"); mainStyleSheet = $('link[title=switch]', d.head); - newStyleSheet = $("link[rel='alternate stylesheet'][title='" + style + "']", d.head); + newStyleSheet = $("link[title='" + style + "']", d.head); mainStyleSheet.href = newStyleSheet.href; return Main.initStyle(); }; diff --git a/builds/crx/script.js b/builds/crx/script.js index f26abb8a4..79afd0598 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -11972,10 +11972,10 @@ return; } Navigate.updateTitle(board); - _ref = board.ws_board ? [(d.cookie.match(/ws\_style\=[^;]+/) || ['Yotsuba B New'])[0], 'ws_style'] : [(d.cookie.match(/nws\_style\=[^;]+/) || ['Yotsuba New'])[0], 'nws_style'], style = _ref[0], type = _ref[1]; + _ref = board.ws_board ? [(d.cookie.match(/ws\_style\=([^;]+)/) || ['', 'Yotsuba B New'])[1], 'ws_style'] : [(d.cookie.match(/nws\_style\=([^;]+)/) || ['', 'Yotsuba New'])[1], 'nws_style'], style = _ref[0], type = _ref[1]; $.globalEval("var style_group = '" + type + "'"); mainStyleSheet = $('link[title=switch]', d.head); - newStyleSheet = $("link[rel='alternate stylesheet'][title='" + style + "']", d.head); + newStyleSheet = $("link[title='" + style + "']", d.head); mainStyleSheet.href = newStyleSheet.href; return Main.initStyle(); }; diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index d8215b805..7672ae4e8 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -137,17 +137,17 @@ Navigate = return unless board Navigate.updateTitle board [style, type] = if board.ws_board then [ - (d.cookie.match(/ws\_style\=[^;]+/) or ['Yotsuba B New'])[0] + (d.cookie.match(/ws\_style\=([^;]+)/) or ['', 'Yotsuba B New'])[1] 'ws_style' ] else [ - (d.cookie.match(/nws\_style\=[^;]+/) or ['Yotsuba New'])[0] + (d.cookie.match(/nws\_style\=([^;]+)/) or ['', 'Yotsuba New'])[1] 'nws_style' ] $.globalEval "var style_group = '#{type}'" - mainStyleSheet = $ 'link[title=switch]', d.head - newStyleSheet = $ "link[rel='alternate stylesheet'][title='#{style}']", d.head + mainStyleSheet = $ 'link[title=switch]', d.head + newStyleSheet = $ "link[title='#{style}']", d.head mainStyleSheet.href = newStyleSheet.href