Don't execute on the 'Temporary Offline' page.
This commit is contained in:
parent
8ceb892cfd
commit
e7fbfe8886
File diff suppressed because one or more lines are too long
@ -46,10 +46,8 @@ Header =
|
||||
order: 105
|
||||
|
||||
$.asap (-> d.body), ->
|
||||
if $ 'link[href*="favicon-status.ico"]', d.head
|
||||
# 404 error page or similar.
|
||||
return
|
||||
$.prepend d.body, Header.headerEl
|
||||
if Main.isThisPageLegit()
|
||||
$.prepend d.body, Header.headerEl
|
||||
$.asap (-> $.id 'boardNavDesktop'), @setBoardList
|
||||
|
||||
setBoardList: ->
|
||||
|
||||
@ -361,9 +361,7 @@ Main =
|
||||
$.ready Main.initReady
|
||||
|
||||
initStyle: ->
|
||||
if $ 'link[href*="favicon-status.ico"]', d.head
|
||||
# 404 error page or similar.
|
||||
return
|
||||
return unless Main.isThisPageLegit()
|
||||
# disable the mobile layout
|
||||
$('link[href*=mobile]', d.head)?.disabled = true
|
||||
$.addClass doc, $.engine
|
||||
@ -487,6 +485,12 @@ Main =
|
||||
textContent: error
|
||||
[message, error]
|
||||
|
||||
isThisPageLegit: ->
|
||||
# 404 error page or similar.
|
||||
unless 'thisPageIsLegit' of Main
|
||||
Main.thisPageIsLegit = !$('link[href*="favicon-status.ico"]', d.head) and d.title isnt '4chan - Temporarily Offline'
|
||||
Main.thisPageIsLegit
|
||||
|
||||
css: """
|
||||
<%= grunt.file.read('css/style.css') %>
|
||||
<%= grunt.file.read('css/yotsuba.css') %>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user