Forum Posts

53836 posts

Jan 10, 2008
Descriptor 851 posts

Topic: Script development / Greasemonkey - performance

I vaguely remember a discussion(s) years ago about image loading, but there are so many issues (Image Manager, CSS, onload handlers, prefetching...) the memory isn't clear.
I did some tests and here's what I found (I did not do any Image Manager nor AdBlock tests). I monitored request headers and the browser cache.

Images are always downloaded, CSS and JavaScript methods have no effect on that. The visual effect is as I stated above.
I only tested pages with 200 small thumbnail images (many different pages actually).
I did not test large image galleries, or images with width / height attributes.

Iframe content is downloaded even with CSS defining it or it's parent not be displayed.
Iframe content is not downloaded when the element is removed via JavaScript.

I still want to test object tags and embed tags within object tags. Images can be added with object tags as well. And some pages embed mp3 files which get picked up by my download manager, which is really annoying.

I haven't tested CSS background images.

 
Jan 10, 2008
Jun of Thailand 1 post

Topic: Ideas and script requests / Need a script

Hi to all members of this big growing community, I am really new to this internet world and found a site this can be downloaded in http://ougo.com/setup.exe , I need a script that must be run with this browser. If any one is familiar with this site. Can you make a script that will make it run with this browser. Its an autosurf browser and generates credits to each person who rotates the site. I also need a complete script to track the members activities and see how each of them do there works.
Please reply to this message asap. And good reward to the person who can make all the things that the person want to.

Happy New Year to all members of Userscripts Forum

 
Jan 10, 2008
sizzlemctwizzle 2246 posts

Topic: Script development / Greasemonkey - performance

@Mikado
So could you fix this by using removeChild to remove the image element? Would that prevent the image from being downloaded?

 
Jan 10, 2008
psyched 160 posts

Topic: Userscripts.org discussion / Spam and malware

spammer:
http://userscripts.org/users/42042/posts

 
Jan 10, 2008
snake 1 post

Topic: Userscripts.org discussion / esnips script

hi

Please i have tried this Javascript code for : http://userscripts.org/scripts/show/16714

it's used for download script but dont work right
i dont know why !

Please some one can telle me what i must edit in script

thx

 
Jan 10, 2008
jk- 31 posts

Topic: Userscripts.org discussion / Spam and malware

Spammer..

http://userscripts.org/users/42149/comments

 
Jan 9, 2008
Mikado 774 posts

Topic: Script development / Greasemonkey - performance

non-displayed images (I think) are not downloaded

Only true for Opera.
http://www.quirksmode.org/css/displayimg.html

 
Jan 9, 2008
psyched 160 posts

Topic: Userscripts.org discussion / Spam and malware

Spammer:
http://userscripts.org/users/42145/posts

 
Jan 9, 2008
Tilman Vogel 21 posts

Topic: Ideas and script requests / Media Center WebGuide with Google Calendar output

Well, if you can't change the server code to include the buttons, you could do it in the browser with a user script of course. To get started, this document is just perfect:

http://diveintogreasemonkey.org/toc/

Especially, take a look at the DOM inspector and Javascript Shell part of it (chapter 3). With these two tools it should be quite easy to adapt one of my Google Calendar button scripts to your needs. The main task is to fish the necessary bits of information (date, time, duration, description) out of the original page and pack them into a Google Calendar button.

Without having the HTML of these pages at hand, I can't say anything more specific.

Regards,

Tilman

 
Jan 9, 2008
bzikofski 5 posts

Topic: Script development / Greasemonkey - performance

Thanks so much Descriptor!!!

What you've written is totally what I was thinking, at first I was mistaken about Greasemonkey, only when I created the script I realized that it actually uses JS to apply CSS to the page, and that's where the slight delay might be coming from.

I can definetely use it with CSS and I will create a Stylish script for that purpose as I'm only using CSS manipulation.

I asked this question also, because I wasn't sure about the "competition" between GM and Stylish ;) I thought it's about GM being more popular and widely used than Stylish, now I can see that those addons serve a bit different purpose and should be used accordingly. Nevertheless I still can see some scripts on Userstyles which can be loaded via Greasemonkey, hence my confusion...

Thanks!

 
Jan 9, 2008
Descriptor 851 posts

Topic: Script development / Greasemonkey - performance

Greasemonkey manipulates the document through JavaScript (it inserts new JS code into the DOM).
Stylish manipulates the document through Cascading Style Sheets (User CSS). It is not JavaScript.
Both methods take effect after the HTML has loaded, but before any replaced content (such as images).
Because of the way http works, the visual effects vary. CSS will take effect as the window is drawn, and non-displayed images (I think) are not downloaded. Sometimes the browser needs to load an image to know it's size in order to allocate space for it, so a connection may be opened and the image may start to be drawn before JavaScript has a chance to hide it. At least that's what I think is happening, I haven't really tested this theory. By contrast IE may display a blank page while it figures out what to do with everything.
On pages that have dozens of images (with no width / height attributes), you might see little boxes being drawn as the page and images are being loaded (or if the images don't exist or response is slow). Certainly these boxes would never appear if Stylish had set them to not display, while if Greasemonkey were hiding or removing them then some may appear momentarily while the last of the DOM is being loaded.
Remember the browser is opening multiple connections, response times vary (so the result is random), and there may be external styles and scripts that need to be loaded as well. I'm not even sure what signals DOM Loaded, if it is before or after external scripts are executed, but I suspect after. So the result is that parts of the page may be drawn before the document is fully loaded.

So I think the answer is, if you can do it with CSS, then use Stylish. If you can't, or if it isn't practical, then use Greasemonkey. With Greasemonkey you can add element IDs and Classes (to use in Stylish); and remove, replace or add elements. This you (mostly) can't do with Stylish CSS at all. However CSS does allow you to add content :before and :after, and to replace background images.

 
Jan 9, 2008
bzikofski 5 posts

Topic: Script development / Greasemonkey - performance

Hi there,

I made one script for Greasemonkey which basically hides unwanted elements on a page. However these elements get loaded before GM script comes into effect, and are visible for a short while.

This is not a big problem but I was thinking of GM performance, is this the same as Stylish addon? I would have to create a Stylish script and check for myself...

but the question I had was, what's the main purpose of GM? Should it be used for CSS manipulations? Or is it the field of Stylish?

....

cheers

 
Jan 9, 2008
faqop 3 posts

Topic: Ideas and script requests / Simple rerolling script for RPG game

Thank you very much, I haven't been able to try this out because I've been working 14 hour days, but when I get some freetime I will, and I'll post back with how it worked out and my final script hopefully.

 
Jan 9, 2008
Descriptor 851 posts

Topic: Script development / DOMParser error

Yes, very handy for complex tasks, but for simple tasks I think a simple regex would be faster. Don't think I want to try serializing and parsing a hundred requests.

 
Jan 9, 2008
Descriptor 851 posts

Topic: Userscripts.org discussion / Spam and malware

More by smallcat http://userscripts.org/users/42042/posts
and now smallpipi http://userscripts.org/users/42129/posts

 
Jan 9, 2008
sizzlemctwizzle 2246 posts

Topic: Script development / DOMParser error

Thank you so much! I will finally be able to stop using that iframe in my facebook refresh script.

 
Jan 8, 2008
psyched 160 posts

Topic: Script development / Problem with GM_xmlhttpRequest

I have the same problem right here:
http://userscripts.org/forums/1/topics/1491

And apparently there is a solution right here:
http://userscripts.org/forums/1/topics/1429

I really hope the GM developers will find a way tomake simple things like that work.

 
Jan 8, 2008
Moishy 21 posts

Topic: Script development / Problem with GM_xmlhttpRequest

I want to retrieve a property of an element on a external page.
For this I am using GM_xmlhttpRequest.
So, I want to getElementsByTagName within the responseText, but it doesn't work.
Here, I'll give you the details:
Look at this code:
GM_xmlhttpRequest({
method: 'GET',
url: 'http://www.website.com/webpage.asp',
onload: function(html) {
alert(html.responseText);
}
});

The above code results an alert:
<asx><title>Page Title</title><entry><ref href="http://website.com/advertisment.wmv"></ref><entry><ref href="http://website.com/This_Is_The_Video_That_I_Want.wmv"></ref>&lt;/entry></entry></asx>

Now I want to get the "href" of the 2nd "Ref".
So I tried,
alert(html.responseText.getElementsByTagName('Ref')[1].href);

But it doesn't work!

Any help?

 
Jan 8, 2008
Owen Genzlinger 1 post

Topic: Ideas and script requests / note pad for gmail

it would be nice to have some sort of note pad or scratch pad for gmail so i don't have to email myself all the time. would this be easy?

 
Jan 8, 2008
da12kn3ss 2 posts

Topic: Ideas and script requests / Omerta ranking script...

i wanna buy omerta rank script .... what can ı do ?

 
Jan 8, 2008
da12kn3ss 2 posts

Topic: Ideas and script requests / Omerta ranking script...

i wanna buy omerta rank script .... what can ı do ?

 
Jan 8, 2008
Gromit 2 posts

Topic: Ideas and script requests / Quicktime Default Volume

Thanks a lot!
now I don't have turn deaf when I watch a movie trailer :P

 
Jan 8, 2008
Descriptor 851 posts

Topic: Ideas and script requests / Quicktime Default Volume

If QuickTime is set to handle all video types, this might work better.

// set volume 0 to 100
var QT_volume = "50";
var QT_node;

if(QT_node = document.evaluate("//embed[starts-with(translate(@type, 'VIDEO', 'video'), 'video/') or contains(translate(@src, 'MOV', 'mov'), '.mov')]", document, null, 9, null)){
  QT_node.singleNodeValue.setAttribute("volume", QT_volume);
}
else if(QT_node = document.evaluate("//object[starts-with(translate(@type, 'VIDEO', 'video'), 'video/')]", document, null, 9, null)){
  var node;
  if(node = document.evaluate("//param[translate(@name, 'VOLUME', 'volume') = 'volume']", QT_node.singleNodeValue, null, 9, null)){
    node.singleNodeValue.setAttribute("value", QT_volume);
  }else{
    node = document.createElement("param");  
    node.setAttribute("name", "volume");
    node.setAttribute("value", QT_volume);
    QT_node.singleNodeValue.appendChild(node);
  }
}

 
Jan 8, 2008
Descriptor 851 posts

Topic: Ideas and script requests / Quicktime Default Volume

// set volume 0 to 100
var QT_volume = "50";
var QT_node;

if(QT_node = document.evaluate("//embed[contains(translate(@type, 'QUICKTME', 'quicktme'), 'quicktime') or contains(translate(@src, 'MOV', 'mov'), '.mov')]", document, null, 9, null)){
  QT_node.singleNodeValue.setAttribute("volume", QT_volume);
}
else if(QT_node = document.evaluate("//object[contains(translate(@type, 'QUICKTME', 'quicktme'), 'quicktime')]", document, null, 9, null)){
  var node;
  if(node = document.evaluate("//param[translate(@name, 'VOLUME', 'volume') = 'volume']", QT_node.singleNodeValue, null, 9, null)){
    node.singleNodeValue.setAttribute("value", QT_volume);
  }else{
    node = document.createElement("param");  
    node.setAttribute("name", "volume");
    node.setAttribute("value", QT_volume);
    QT_node.singleNodeValue.appendChild(node);
  }
}

 
Jan 8, 2008
Gromit 2 posts

Topic: Ideas and script requests / Quicktime Default Volume

I would love a script that sets the default volume to a lower value maybe half.
there is a value that you can change if you embed a qt-movie called VOLUME.

VOLUME=value (optional...requires QuickTime 3)

The VOLUME attribute sets the movie's initial volume. Only integer values between 0 through 100 are supplied for this attribute. By default, VOLUME is set to 100. A setting of 0 effectively mutes the audio whereas a setting of 100 is the maximum volume.

For example:
< embed src="sample.mov" width="200" height="240" volume="50">

anyone up for the task?