Merge branch 'next'
This commit is contained in:
commit
497dbe9b13
@ -393,6 +393,9 @@ Settings =
|
|||||||
if compareString < '00001.00012.00000.00006'
|
if compareString < '00001.00012.00000.00006'
|
||||||
if data['sauces']?
|
if data['sauces']?
|
||||||
set 'sauces', data['sauces'].replace(/^(#?\s*)https:\/\/(?:desustorage|cuckchan)\.org\//mg, '$1https://desuarchive.org/')
|
set 'sauces', data['sauces'].replace(/^(#?\s*)https:\/\/(?:desustorage|cuckchan)\.org\//mg, '$1https://desuarchive.org/')
|
||||||
|
if compareString < '00001.00012.00001.00000'
|
||||||
|
if not data['Persistent Thread Watcher']? and data['Toggleable Thread Watcher']?
|
||||||
|
set 'Persistent Thread Watcher', not data['Toggleable Thread Watcher']
|
||||||
changes
|
changes
|
||||||
|
|
||||||
loadSettings: (data, cb) ->
|
loadSettings: (data, cb) ->
|
||||||
|
|||||||
@ -97,6 +97,9 @@ Keybinds =
|
|||||||
when Conf['Update thread watcher']
|
when Conf['Update thread watcher']
|
||||||
return unless ThreadWatcher.enabled
|
return unless ThreadWatcher.enabled
|
||||||
ThreadWatcher.buttonFetchAll()
|
ThreadWatcher.buttonFetchAll()
|
||||||
|
when Conf['Toggle thread watcher']
|
||||||
|
return unless ThreadWatcher.enabled
|
||||||
|
ThreadWatcher.toggleWatcher()
|
||||||
# Images
|
# Images
|
||||||
when Conf['Expand image']
|
when Conf['Expand image']
|
||||||
return unless ImageExpand.enabled and threadRoot
|
return unless ImageExpand.enabled and threadRoot
|
||||||
|
|||||||
@ -34,10 +34,10 @@ ThreadWatcher =
|
|||||||
|
|
||||||
if Conf['Fixed Thread Watcher']
|
if Conf['Fixed Thread Watcher']
|
||||||
$.addClass doc, 'fixed-watcher'
|
$.addClass doc, 'fixed-watcher'
|
||||||
if Conf['Toggleable Thread Watcher']
|
if !Conf['Persistent Thread Watcher']
|
||||||
@dialog.hidden = true
|
@dialog.hidden = true
|
||||||
Header.addShortcut 'watcher', sc, 510
|
|
||||||
$.addClass doc, 'toggleable-watcher'
|
Header.addShortcut 'watcher', sc, 510
|
||||||
|
|
||||||
ThreadWatcher.fetchAuto()
|
ThreadWatcher.fetchAuto()
|
||||||
|
|
||||||
|
|||||||
@ -384,9 +384,9 @@ Config =
|
|||||||
'Makes the thread watcher scroll with the page.'
|
'Makes the thread watcher scroll with the page.'
|
||||||
1
|
1
|
||||||
]
|
]
|
||||||
'Toggleable Thread Watcher': [
|
'Persistent Thread Watcher': [
|
||||||
true
|
false
|
||||||
'Adds a shortcut for the thread watcher and hides the watcher by default.'
|
'The thread watcher will be visible when the page is loaded.'
|
||||||
1
|
1
|
||||||
]
|
]
|
||||||
'Mark New IPs': [
|
'Mark New IPs': [
|
||||||
@ -862,6 +862,10 @@ Config =
|
|||||||
'Shift+r'
|
'Shift+r'
|
||||||
'Manually refresh thread watcher.'
|
'Manually refresh thread watcher.'
|
||||||
]
|
]
|
||||||
|
'Toggle thread watcher': [
|
||||||
|
't'
|
||||||
|
'Toggle visibility of thread watcher.'
|
||||||
|
]
|
||||||
# Images
|
# Images
|
||||||
'Expand image': [
|
'Expand image': [
|
||||||
'Shift+e'
|
'Shift+e'
|
||||||
|
|||||||
@ -931,9 +931,6 @@ span.hide-announcement {
|
|||||||
#thread-watcher a {
|
#thread-watcher a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
:root:not(.toggleable-watcher) #thread-watcher .move > .close {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#thread-watcher .move > .close {
|
#thread-watcher .move > .close {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
|
|||||||
@ -52,6 +52,7 @@ Main =
|
|||||||
Conf['Show Name and Subject'] = false
|
Conf['Show Name and Subject'] = false
|
||||||
Conf['QR Shortcut'] = true
|
Conf['QR Shortcut'] = true
|
||||||
Conf['Bottom QR Link'] = true
|
Conf['Bottom QR Link'] = true
|
||||||
|
Conf['Toggleable Thread Watcher'] = true
|
||||||
|
|
||||||
# Pseudo-enforce default whitelist while configuration loads
|
# Pseudo-enforce default whitelist while configuration loads
|
||||||
if $.platform is 'crx' then $.global ->
|
if $.platform is 'crx' then $.global ->
|
||||||
|
|||||||
@ -1,6 +1,24 @@
|
|||||||
requestID = 0
|
requestID = 0
|
||||||
|
|
||||||
chrome.runtime.onMessage.addListener (request, sender, sendResponse) ->
|
chrome.runtime.onMessage.addListener (request, sender, sendResponse) ->
|
||||||
|
if request.responseType is 'arraybuffer'
|
||||||
|
# Cross-origin image fetching. Need permission.
|
||||||
|
chrome.permissions.contains
|
||||||
|
origins: ['*://*/']
|
||||||
|
, (result) ->
|
||||||
|
if result
|
||||||
|
ajax request, sender, sendResponse
|
||||||
|
else
|
||||||
|
chrome.permissions.request
|
||||||
|
origins: ['*://*/']
|
||||||
|
, ->
|
||||||
|
ajax request, sender, sendResponse
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
# JSON fetching from non-HTTPS archive.
|
||||||
|
ajax request, sender, sendResponse
|
||||||
|
|
||||||
|
ajax = (request, sender, sendResponse) ->
|
||||||
id = requestID
|
id = requestID
|
||||||
requestID++
|
requestID++
|
||||||
sendResponse id
|
sendResponse id
|
||||||
@ -10,11 +28,11 @@ chrome.runtime.onMessage.addListener (request, sender, sendResponse) ->
|
|||||||
xhr.responseType = request.responseType
|
xhr.responseType = request.responseType
|
||||||
xhr.addEventListener 'load', ->
|
xhr.addEventListener 'load', ->
|
||||||
if @readyState is @DONE && xhr.status is 200
|
if @readyState is @DONE && xhr.status is 200
|
||||||
contentType = @getResponseHeader 'Content-Type'
|
|
||||||
contentDisposition = @getResponseHeader 'Content-Disposition'
|
|
||||||
{response} = @
|
{response} = @
|
||||||
if request.responseType is 'arraybuffer'
|
if request.responseType is 'arraybuffer'
|
||||||
response = [new Uint8Array(response)...]
|
response = [new Uint8Array(response)...]
|
||||||
|
contentType = @getResponseHeader 'Content-Type'
|
||||||
|
contentDisposition = @getResponseHeader 'Content-Disposition'
|
||||||
chrome.tabs.sendMessage sender.tab.id, {id, response, contentType, contentDisposition}
|
chrome.tabs.sendMessage sender.tab.id, {id, response, contentType, contentDisposition}
|
||||||
else
|
else
|
||||||
chrome.tabs.sendMessage sender.tab.id, {id, error: true}
|
chrome.tabs.sendMessage sender.tab.id, {id, error: true}
|
||||||
|
|||||||
@ -25,7 +25,9 @@
|
|||||||
<% } %> "minimum_chrome_version": "<%= meta.min.chrome %>",
|
<% } %> "minimum_chrome_version": "<%= meta.min.chrome %>",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"storage",
|
"storage",
|
||||||
"http://*/",
|
"*://a.4cdn.org/"
|
||||||
"https://*/"
|
],
|
||||||
|
"optional_permissions": [
|
||||||
|
"*://*/"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ CrossOrigin =
|
|||||||
# XXX https://forums.lanik.us/viewtopic.php?f=64&t=24173&p=78310
|
# XXX https://forums.lanik.us/viewtopic.php?f=64&t=24173&p=78310
|
||||||
url = url.replace /^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/'
|
url = url.replace /^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/'
|
||||||
<% if (type === 'crx') { %>
|
<% if (type === 'crx') { %>
|
||||||
if /^https:\/\//.test(url) or location.protocol is 'http:'
|
if url.split('/')[...3].join('/') is "#{location.protocol}//i.4cdn.org"
|
||||||
xhr = new XMLHttpRequest()
|
xhr = new XMLHttpRequest()
|
||||||
xhr.open 'GET', url, true
|
xhr.open 'GET', url, true
|
||||||
xhr.setRequestHeader key, value for key, value of headers
|
xhr.setRequestHeader key, value for key, value of headers
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user