Hi guys. Is there a way to execute some javascript on load a web site. For example I want to hide facebook chat and I want to execute document.getElementById('pagelet_chat_home').style.display = "none" on loading a site.
+3
A:
You could wrap the needed actions into a greasmonkey script - Chrome supports greasemonkey user scripts out of the box and converts them into a plugins automatically.
Save the following as script.user.js
and open it with Chrome. Chrome should detect it as a plugin and install it. Didn't check if it actually works but there shouldn't be any problems.
// ==UserScript==
// @name Hide Pagelet
// @namespace hide_pagelet
// @description An example Greasemonkey script that hides a pagelet
// @include http://*.facebook.com/*
// ==/UserScript==
document.getElementById('pagelet_chat_home').style.display = "none";
Andris
2010-07-22 09:15:05
thanks. And what about other browsers ( IE, Firefox ). Are they support greasmonkey script or can use other ways.
Ilian
2010-07-22 16:37:51
Firefox supports Greasemonkey scripts through a plugin. http://en.wikipedia.org/wiki/Greasemonkey
Andris
2010-07-22 17:06:22