On Mon, Nov 24, 2003 at 08:26:43PM +0200, Dan Kenigsberg wrote:
> All of us are familiar with annoying javascript functions on specific pages,
> that do somthing that is not understood by our browser, or is simply unwanted to
> us end-users.
>
> Wouldn't it be nice to say to mozilla:
> http://some.url/page.html defines a function called doBadThing.
> would you please run the function doGood() {} instead of it whenever
> requested?
>
> Now to my question: is there a mozilla extension that does just that?
I think you could implement that with bindings (similar to IE's
Behaviors). Some of you might already know that you can apply your own
styles to web pages using the userContent.css file
(content/userContent.css in your Gecko profile directory).
For example, the flying yellow submarine on www.yellow-submarine.org
(which doesn't work well on Linux Flash plugin) annoyed me, so I added:
embed[name=flying_sub]
{
display:none;
}
Violla, no more submarine.
---
Some of you might also know that there's a proprietary Mozilla feature
called 'bindings'. It allows you, through CSS, to assign event handlers
to HTML objects.
For example,
html
{
-moz-binding: url("file:/.../blah.xbl#myHtmlOverride") !important;
}
Now, for any page with a HTML tag, it'll consult blah.xbl, giving you
the opportunity to customize everything about it.
---
Example contents of blah.xbl:
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="myHtmlOverride">
<content>
<children/>
<html:script>
<![CDATA[
// This will allow you to override doBadThing after it was
// declared with your implementation. Of course, a good idea
// would be to check document.location.href, to make sure
// you really wish to override functions on _this_ URL.
window.doBadThing = new function()
{
// do some good here
}
]]>
</html:script>
</content>
</binding>
</bindings>
--
See:
http://www.mozilla.org/projects/xbl/xbl.html
http://docs.mandragor.org/files/Misc/Mozilla_applications_en/mozilla-chp-7-sect-2.html
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]