Remove sandbox option for Sauce links. #904
This commit is contained in:
parent
ae09e162f9
commit
4caa66d556
@ -3,7 +3,6 @@
|
|||||||
<div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div>
|
<div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div>
|
||||||
<div>You can specify the applicable boards by appending <code>;boards:[board1],[board2]</code>.</div>
|
<div>You can specify the applicable boards by appending <code>;boards:[board1],[board2]</code>.</div>
|
||||||
<div>You can specify the applicable file types by appending <code>;types:[extension1],[extension2]</code>.</div>
|
<div>You can specify the applicable file types by appending <code>;types:[extension1],[extension2]</code>.</div>
|
||||||
<div>You can open links with scripts and popups disabled by appending <code>;sandbox</code>.</div>
|
|
||||||
<ul>These parameters will be replaced by their corresponding values:
|
<ul>These parameters will be replaced by their corresponding values:
|
||||||
<li><code>%TURL</code>: Thumbnail URL.</li>
|
<li><code>%TURL</code>: Thumbnail URL.</li>
|
||||||
<li><code>%URL</code>: Full image URL.</li>
|
<li><code>%URL</code>: Full image URL.</li>
|
||||||
|
|||||||
@ -18,15 +18,6 @@ Sauce =
|
|||||||
name: 'Sauce'
|
name: 'Sauce'
|
||||||
cb: @node
|
cb: @node
|
||||||
|
|
||||||
sandbox: (url) ->
|
|
||||||
E.url <%= readHTML('Sandbox.html') %>
|
|
||||||
|
|
||||||
rmOrigin: (e) ->
|
|
||||||
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
|
||||||
# Work around mixed content restrictions (data: URIs have inherited origin).
|
|
||||||
$.open @href
|
|
||||||
e.preventDefault()
|
|
||||||
|
|
||||||
createSauceLink: (link, post) ->
|
createSauceLink: (link, post) ->
|
||||||
return null unless link = link.trim()
|
return null unless link = link.trim()
|
||||||
|
|
||||||
@ -57,14 +48,10 @@ Sauce =
|
|||||||
return null unless !parts['boards'] or post.board.ID in parts['boards'].split ','
|
return null unless !parts['boards'] or post.board.ID in parts['boards'].split ','
|
||||||
return null unless !parts['types'] or ext in parts['types'].split ','
|
return null unless !parts['types'] or ext in parts['types'].split ','
|
||||||
|
|
||||||
url = parts['url']
|
|
||||||
url = Sauce.sandbox url if parts['sandbox']?
|
|
||||||
|
|
||||||
a = Sauce.link.cloneNode false
|
a = Sauce.link.cloneNode false
|
||||||
a.href = url
|
a.href = parts['url']
|
||||||
a.textContent = parts['text']
|
a.textContent = parts['text']
|
||||||
a.removeAttribute 'target' if /^javascript:/i.test parts['url']
|
a.removeAttribute 'target' if /^javascript:/i.test parts['url']
|
||||||
$.on a, 'click', Sauce.rmOrigin if parts['sandbox']?
|
|
||||||
a
|
a
|
||||||
|
|
||||||
node: ->
|
node: ->
|
||||||
|
|||||||
@ -1,16 +0,0 @@
|
|||||||
<html><head>
|
|
||||||
<title>[sb] ${url}</title>
|
|
||||||
<style>
|
|
||||||
iframe \{
|
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
|
||||||
border: 0;
|
|
||||||
\}
|
|
||||||
body \{
|
|
||||||
margin: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
\}
|
|
||||||
</style>
|
|
||||||
</head><body>
|
|
||||||
<iframe sandbox="allow-forms" src="${url}"></iframe>
|
|
||||||
</body></html>
|
|
||||||
@ -720,7 +720,7 @@ Config =
|
|||||||
#//saucenao.com/search.php?url=%IMG
|
#//saucenao.com/search.php?url=%IMG
|
||||||
|
|
||||||
# "View Same" in archives:
|
# "View Same" in archives:
|
||||||
http://eye.swfchan.com/search/?q=%name;types:swf;sandbox
|
http://eye.swfchan.com/search/?q=%name;types:swf
|
||||||
#https://desustorage.org/_/search/image/%sMD5/
|
#https://desustorage.org/_/search/image/%sMD5/
|
||||||
#https://archive.4plebs.org/_/search/image/%sMD5/
|
#https://archive.4plebs.org/_/search/image/%sMD5/
|
||||||
#https://boards.fireden.net/_/search/image/%sMD5/
|
#https://boards.fireden.net/_/search/image/%sMD5/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user