OSDN Git Service

separate no referer support javascript functions
authorishikawa <ishikawa@180c8125-5b33-4295-ad04-72a68a15b4cc>
Thu, 16 Jul 2009 15:08:36 +0000 (15:08 +0000)
committerishikawa <ishikawa@180c8125-5b33-4295-ad04-72a68a15b4cc>
Thu, 16 Jul 2009 15:08:36 +0000 (15:08 +0000)
lib/public/noreferer-keitairc.js [new file with mode: 0644]

diff --git a/lib/public/noreferer-keitairc.js b/lib/public/noreferer-keitairc.js
new file mode 100644 (file)
index 0000000..cb7fea9
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ -*- mode: javascript; coding: utf-8 -*-
+ $Id: noreferer-keitairc.js,v 1.1 2009-07-16 15:08:36 ishikawa Exp $
+
+ Copyright (c) 2009 ISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
+ This program is covered by the GNU General Public License 2
+*/
+
+function noreferer(a){
+       var url = a.href;
+       var html = '<html><head><script type="text/javascript">'
+               + 'document.write(\'<meta http-equiv="refresh" content="0;url='+url+'">\');'
+               + '<'+'/script></head><body></body></html>';
+       a.href = 'data:text/html;charset=utf-8,'+encodeURIComponent(html);
+}
+
+function restore_original(a){
+       a.href = a.getAttribute('o_href');
+}