打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
greasemonky 更改当前页面的 脚本
因为图省事儿。在平常看的
http://booklink.me/ 的首页给自动转到书架页面(这样节省了空间)
就自己写了个JS脚本,(需要在greasemonkey 平台)
(不足之处就在于:页面会先load主页面信息,也就是会闪一下,再转到书架页面。)

代码如下

// Released under the GPL license
// Tiger Deng
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.3 or later:
// Then restart Firefox and revisit this script.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name URL Replacer
// @namespace http://booklink.me/
// @description Replaces the main page url into bookshelf
// @include http://*
// @include https://*
// ==/UserScript==

if (document.URL == "http://booklink.me/")
{
location.href ="http://booklink.me/fav_book.php";
}


//
// ChangeLog
// 2005-04-18 - 0.2 - MAP - Its just the beginning
// Released under the GPL license
// Tiger Deng
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.  To install it, you need
// Greasemonkey 0.3 or later:
// Then restart Firefox and revisit this script.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name          URL Replacer
// @namespace     http://booklink.me/
// @description   Replaces the main page url into bookshelf
// @include       http://*
// @include       https://*
// ==/UserScript==

if (document.URL == "http://booklink.me/")
{
    location.href ="http://booklink.me/fav_book.php";
}
var curURL = document.URL;
if( curURL.indexOf("6park") != -1)
{
   location.href ="http://www.google.com";
}
// Released under the GPL license
// Tiger Deng
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.3 or later:
// Then restart Firefox and revisit this script.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name URL Replacer
// @namespace http://booklink.me/
// @description Replaces the main page url into bookshelf
// @include http://*
// @include https://*
// ==/UserScript==

if (document.URL == "http://booklink.me/")
{
location.href ="http://booklink.me/fav_book.php";
}


//
// ChangeLog
// 2005-04-18 - 0.2 - MAP - Its just the beginning
// Released under the GPL license
// Tiger Deng
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.3 or later:
// Then restart Firefox and revisit this script.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name URL Replacer
// @namespace http://booklink.me/
// @description Replaces the main page url into bookshelf
// @include http://*
// @include https://*
// ==/UserScript==

if (document.URL == "http://booklink.me/")
{
location.href ="http://booklink.me/fav_book.php";
}


//
// ChangeLog
// 2005-04-18 - 0.2 - MAP - Its just the beginning
// Released under the GPL license
// Tiger Deng
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.3 or later:
// Then restart Firefox and revisit this script.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name URL Replacer
// @namespace http://booklink.me/
// @description Replaces the main page url into bookshelf
// @include http://*
// @include https://*
// ==/UserScript==

if (document.URL == "http://booklink.me/")
{
location.href ="http://booklink.me/fav_book.php";
}


//
// ChangeLog
// 2005-04-18 - 0.2 - MAP - Its just the beginning
// Released under the GPL license
// Tiger Deng
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.3 or later:
// Then restart Firefox and revisit this script.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name URL Replacer
// @namespace http://booklink.me/
// @description Replaces the main page url into bookshelf
// @include http://*
// @include https://*
// ==/UserScript==

if (document.URL == "http://booklink.me/")
{
location.href ="http://booklink.me/fav_book.php";
}


//
// ChangeLog
// 2005-04-18 - 0.2 - MAP - Its just the beginning
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
我的 Web 我做主: Greasemonkey 入门篇
!!!!! .kmm Greasify 0.7.9.5.1rc Module for K-Meleon v1.5, 1.6, 1.7 series (updated Jan. 24, 2011)
Gist 介绍
页面刷新
【教程、无技术含量】简单的油猴脚本编写教程
深入浅出-油猴脚本
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服