Counterglow Forums  

Go Back   Counterglow Forums > General Discussions > Technoglow

Reply
 
Thread Tools Display Modes
Old 08-08-2006, 01:07:10   #1
Deacon
Washes his hands.
 
Deacon's Avatar
 
Join Date: Jan 2002
Location: Illinois.
Opera User Javascript is one more great feature.

Let's say I use My Excite as my browser's startup page. I like most of the content, except for that one section titled "Excite Highlights". It's filled with ads and dumb celebrity news which will never interest me. This section does not have an "X" to get rid of it. So I'm stuck, right? Wrong.

For the domain "excite.com", I turned on User Scripts. Opera has built-in objects and methods to override variables, functions, events, etc. in Javascripts run by websites. In my UserJS directory, I put the following:

Code:
if(location.hostname.indexOf('excite.com') != -1)
{
  window.opera.defineMagicVariable(
    'nwMedia',
    function ()
    {
      return 0;
    },
    null
  );

  window.opera.addEventListener(
    'BeforeScript',
    function (e)
    {
        e.element.text = e.element.text.replace(/Excite Highlights/g, '');
    },
    false
  );
}

Reload the page, and it's gone. It's so much easier to destroy than to create.
Deacon is offline   Reply With Quote
Reply
Forum Jump

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 10:05:28.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© Counterglow 2001-2012. All rights reserved.