Firefox 4中的Greasemonkey脚本需要更改网页上的一行代码 [英] Greasemonkey script in Firefox 4, want to change one line of code on webpage

查看:161
本文介绍了Firefox 4中的Greasemonkey脚本需要更改网页上的一行代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我会尽量使这个尽可能简单,而不是太模糊。我想更改网页上的一行代码,希望防止出现预览窗格。



原始代码行

 < div id =previewpaneclass =previewpanesytle =height:139px;> 

我想用上面的行代替


 < div id =previewpaneclass =previewpane previewpane-hidestyle =height:139px;> 

我以前写过一个Greasemonkey 脚本,但不幸的是我有困难的应用从这个脚本学到的技术到这个新的,因此这个职位。



欢呼

-Chris

解决方案

这很简单。这是一个应该工作的完整脚本(更改包含行)。

  // == UserScript == 
// @name简单页面调整器
// @description隐藏窗格?
// @include http://stackoverflow.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js
// == / UserScript ==

$(#previewpane)。addClass(previewpane-hide);


Alright, I will try to make this is as simple as possible, without being too vague. I want to change one of line of code on a webpage in hopes of preventing a preview pane from appearing.

Original line of code

<div id="previewpane" class="previewpane" sytle="height: 139px;">

I want to replace the above line with

<div id="previewpane" class="previewpane previewpane-hide" style="height:139px;">

I have previously written one Greasemonkey script but unfortunately I am have having difficulty applying the techniques learned from that script into this new one, thus this post.

cheers
-Chris

解决方案

That's pretty easy. Here's a complete script that should work (change the include line).

// ==UserScript==
// @name            Easy Page tweaker
// @description     Hides pane?
// @include         http://stackoverflow.com/*
// @require         http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js
// ==/UserScript==

$("#previewpane").addClass ("previewpane-hide");

这篇关于Firefox 4中的Greasemonkey脚本需要更改网页上的一行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆