Craigslist Post Renew in New Window

This modifies your post renewal links in your account, to popup in a new window. I was annoyed that CL would use the same window, and then I would have to click back, and click the next renew link, etc etc.

当前为 2014-12-07 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name           Craigslist Post Renew in New Window
// @namespace      Craigslist Post Renew in New Window
// @description    This modifies your post renewal links in your account, to popup in a new window. I was annoyed that CL would use the same window, and then I would have to click back, and click the next renew link, etc etc.
// @include        https://accounts.craigslist.org/
// @include	   https://accounts.craigslist.org/login/home
// @version 0.0.1.20141207215649
// ==/UserScript==

var autoclick = "no"; //Change this to yes (and make sure you allow popups from accounts.craigslist.org) if you want it to click the links for you
/*
DO NOT CHANGE ANYTHING BELOW
*/
for (i=0; i<document.forms.length; i++) {
	var form = document.forms[i];
	var counter = 0;
	if(form.elements.namedItem("go")){
		var input = form.elements.namedItem("go");
		var go_val = input.value;
		if(go_val == "renew"){
			document.forms[i].setAttribute('target','_blank');
			autoclick = autoclick.toLowerCase();
			if(autoclick == "yes"){
				counter = 1;
				document.forms[i].submit();
			}
		}
	}
}

if(counter == 1){ //this will cause the page to refresh to display the renewed posting
	location.reload(true);	
}