mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-12 07:11:42 +09:00
Add Blankshield.js and URI.js
This commit is contained in:
parent
1042479d5b
commit
1bf96e646e
6 changed files with 120 additions and 10 deletions
9
common/js/plugins/blankshield/blankshield.min.js
vendored
Normal file
9
common/js/plugins/blankshield/blankshield.min.js
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* blankshield - Prevent reverse tabnabbing phishing attacks caused by _blank
|
||||
*
|
||||
* @version 0.6.0
|
||||
* @link https://github.com/danielstjules/blankshield
|
||||
* @author Daniel St. Jules <danielst.jules@gmail.com>
|
||||
* @license MIT
|
||||
*/
|
||||
!function(e){"use strict";function n(e){if("undefined"==typeof e.length)o(e,"click",t);else if("string"!=typeof e&&!(e instanceof String))for(var n=0;n<e.length;n++)o(e[n],"click",t)}function t(e){var t,o,i,d;return e=e||window.event,t=e.currentTarget||e.srcElement,i=t.getAttribute("href"),i&&(d=e.ctrlKey||e.shiftKey||e.metaKey,o=t.getAttribute("target"),d||o&&!r(o))?(n.open(i),e.preventDefault?e.preventDefault():e.returnValue=!1,!1):void 0}function o(e,n,t){var o,i;return e.addEventListener?e.addEventListener(n,t,!1):(o="on"+n,e.attachEvent?e.attachEvent(o,t):e[o]?(i=e[o],e[o]=function(){t(),i()}):e[o]=t,void 0)}function i(e,n,t){var o,i,r,d,u;return o=document.createElement("iframe"),o.style.display="none",document.body.appendChild(o),i=o.contentDocument||o.contentWindow.document,d='"'+e+'"',n&&(d+=', "'+n+'"'),t&&(d+=', "'+t+'"'),r=i.createElement("script"),r.type="text/javascript",r.text="window.parent = null; window.top = null;window.frameElement = null; var child = window.open("+d+");child.opener = null",i.body.appendChild(r),u=o.contentWindow.child,document.body.removeChild(o),u}function r(e){return"_top"===e||"_self"===e||"_parent"===e}var d=-1!==navigator.userAgent.indexOf("MSIE"),u=window.open;n.open=function(e,n,t){var o;return r(n)?u.apply(window,arguments):d?(o=u.apply(window,arguments),o.opener=null,o):i(e,n,t)},n.patch=function(){window.open=function(){return n.open.apply(this,arguments)}},"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports?module.exports=n:exports.blankshield=n),"function"==typeof define&&"object"==typeof define.amd&&define("blankshield",[],function(){return n}),e.blankshield=n}(this);
|
||||
1
common/js/plugins/blankshield/plugin.load
Normal file
1
common/js/plugins/blankshield/plugin.load
Normal file
|
|
@ -0,0 +1 @@
|
|||
blankshield.min.js
|
||||
Loading…
Add table
Add a link
Reference in a new issue