Depolying your own password management tool -- KeeWeb Depoly your flask app into Heroku Fix shit IE code manually ISBN to Book Category by Scraping DangDang A Generic Makefile for C/C++ Program Configure Raspberry pi Remove watermark with PyPDF2 tips for docker Anaconda+TensorFlow+CUDA Snippets Configure Remote Mathematica Kernel Build your own ngrok server Access Array SSL VPN 使用Rstudio制作html5幻灯片 tips for Mac OS X system Tips for ipython notebook 配置Ubuntu server + Openbox (Obuntu) tips for Vimperator tips for Vim 安装CUDA My First Jekyll Blog rsync常见选项 在Linux中读取Ipod touch的文件 tip for texmacs 在VPS上建站的一些tip Gnuplot绘图札记 Samba系统和autofs自动挂载 Linux中alsamixer声卡无法录音 搭建自己的RSS订阅器——Tiny Tiny RSS Grub2引导安装Ubuntu awk tips 将Ubuntu系统装入U盘 The Great Rtorrent 编译GCC 再这样剁手!!!该死的libgd 使用ulimit进行资源限制 使用SSH代理上IPV6 使用RCurl抓取网页数据 修复Ubuntu Grub记 openbox中的文件关联 在Ubuntu 12.04下编译qtiplot 处理BCM4312网卡驱动纪实 配置我的Ubuntu Server记 Cygwin杂记 Linux 使普通用户具有以超级权限执行脚本 让firefox自定义地处理文件类型 WordPress优秀主题及插件 在phpcloud上搭建wordpress UBUNTU下用pptpd做VPN server ubuntu升级内核过后的一些问题 安装telnet服务 kubuntu札记 64位kubuntu札记 统计软件R virtualbox stardict星际译王 Ubuntu重装windows系统后的grub引导修复 SSH服务及花生壳域名解析 采用cbp2make工具由code::blocks工程创建makefile文件 UBUNTU 札记

Fix shit IE code manually


I got a webpage which only support IE7 and older IE. After some digging I found out it just use some very old JS method and the most important function is just implemented with XML HTTP Request. So I decided to make the request myself.

I write a bookmarklet (which can be compressed with to do the job.

iframe = document.getElementsByName('midFrame')[0].contentWindow.document.getElementsByName('main')[0];
	var alert_div = document.createElement("div"); = "session_sid"; = "
	font-size: 1.6rem;
	height: auto;
	position: fixed;
	text-align: center;
	width: 100%;
	color: #fff;
	padding: 20px;

token = 'method=login&arguments=can&not=be&told=because&of=privacy';

xhr = new XMLHttpRequest();
xhr.onreadystatechange = stateChange;"GET", '/aim/'+token, true);

const copyToClipboard = str => {
  const el = document.createElement('textarea');  
  el.value = str;                                 
  el.setAttribute('readonly', '');          = 'absolute';           = '-9999px';                      
  const selected =            
    document.getSelection().rangeCount > 0        
      ? document.getSelection().getRangeAt(0)     
      : false;                             ;                                    
  if (selected) {                                

function stateChange() {
	if (xhr.readyState === 4) {
		if (xhr.status === 200) {
			iframe = document.getElementsByName('midFrame')[0].contentWindow.document.getElementsByName('main')[0];
			iframe.contentWindow.document.getElementById('session_sid').innerHTML = xhr.responseText;
		} else {

Here are some notes:

  • A lot of Frame are used, we need to get into the correct level with method contentWindow.

  • You may use following code to send the result into clipboard:

iframe.contentWindow.document.getElementById('session_sid').innerHTML = '<input type="text" value="'+xhr.responseText+'" id="sid" readonly>';