[Opera] Hotmail Empty Junkmail fix


Recommended Posts

There is an infamous "bug" where you can't empty junkmail in hotmail when using Opera because of Hotmail sending different code to opera.

With Opera8, you can have "user javascript" files that will execute on whatever sites you define. So using this, I have attempted to write code to fix this infamous bug simply by dropping this js file in your userjs folder (defined in prefs > advanced > content > javascript options...).

Here it is. I don't really use hotmail, so I had no junkmail.. but it seems to work from what I could see. Any brave souls want to try it out?

// ==UserScript==
// @include http://*.hotmail.com/*
// @include http://*.hotmail.msn.com/*
// ==/UserScript==

window.opera.defineMagicVariable(
    'ie',
    function (curVal) { return true; },
    function (newVal) { if(!newVal) { window.status = 'Repairing script'; } }
);

window.opera.defineMagicFunction(
    'CloseModal',
    function( real, thisObject, fv ) {
    if( thisObject == window ) {

        var frm = window.opener.document.hotmail;

        if (frm.rj.checked)
            R = 2;
        else
            R = 1;

        var jmfAct = 'delete';

        if (R==2)
        {
            frm.rj.value="yes";
            frm.ReportLevel.value="1";
            frm._HMaction.value=jmfAct;
            
            //if (jmfAct=='doEmpty')
            frm.DoEmpty.value="1"
            frm.submit();
        }
        else if (R==1)
        {
            frm.rj.value="no";
            frm.ReportLevel.value="1";
            frm._HMaction.value=jmfAct;

            //if (jmfAct=='doEmpty')
            frm.DoEmpty.value="1"
            frm.submit();
        }

        window.close();

        return false;
    } 
    else {
        return real.apply( thisObject, arguments.slice(2) ); 
    }
  }
);

Save this to a .js file and drop it in the proper folder.

Link to comment
Share on other sites

I tried this js. I clicked on the Empty button. A javascript window popped up. I clicked OK. The js window disappeared and the page refreshed, but nothing happened.

Link to comment
Share on other sites

Sorry. Here is the working code:

// ==UserScript==
// @include http://*.hotmail.com/*
// @include http://*.hotmail.msn.com/*
// ==/UserScript==

window.opera.defineMagicVariable(
 ? ?'ie',
 ? ?function (curVal) { return true; },
 ? ?function (newVal) { if(!newVal) { window.status = 'Repairing script'; } }
);

window.opera.defineMagicFunction(
 ? ?'CloseModal',
 ? ?function( real, thisObject, fv ) {
 ? ?if( thisObject == window ) {

 ? ? ? ?var frm = window.opener.document.hotmail;

 ? ? ? ?if (frm.rj.checked)
 ? ? ? ? ? ?R = 2;
 ? ? ? ?else
 ? ? ? ? ? ?R = 1;

 ? ? ? ?var jmfAct = 'delete';
 ? ? ? ?
 ? ? ? ?checkAll();

 ? ? ? ?if (R==2)
 ? ? ? ?{
 ? ? ? ? ? ?frm.rj.value="yes";
 ? ? ? ? ? ?frm.ReportLevel.value="1";
 ? ? ? ? ? ?frm._HMaction.value=jmfAct;
 ? ? ? ? ? ?frm.DoEmpty.value="1"
 ? ? ? ? ? ?frm.submit();
 ? ? ? ?}
 ? ? ? ?else if (R==1)
 ? ? ? ?{
 ? ? ? ? ? ?frm.rj.value="no";
 ? ? ? ? ? ?frm.ReportLevel.value="1";
 ? ? ? ? ? ?frm._HMaction.value=jmfAct;
 ? ? ? ? ? ?frm.DoEmpty.value="1"
 ? ? ? ? ?  frm.submit();
 ? ? ? ?}

 ? ? ? ?window.close();

 ? ? ? ?return false;
 ? ?} 
 ? ?else {
 ? ? ? ?return real.apply( thisObject, arguments.slice(2) ); 
 ? ?}
 ?}
);

function checkAll()
{
 ? ?var trk=0;
 ? ?var frm = window.opener.document.hotmail;

 ? ?for (var i = 0; i < frm.elements.length; i++)
 ? ?{
 ? ? ? ?var e = frm.elements[i];
 ? ? ? ?if ((e.name != 'allbox') && (e.type=='checkbox'))
 ? ? ?:)?{
 ? ? ? ? ? ?trk++;
 ? ? ? ? ? ?e.checked = "checked";
 ? ? ? ?}
 ? ?}
}

Tested and it works :)

Link to comment
Share on other sites

Works perfectly, Thanks for sharing!

Pity one has to go thru such methods to browse properly though!

585819545[/snapback]

Yeah, but it's not Operas fault. They at least provide a way to fix it.

Link to comment
Share on other sites

This is what I'm using:

Version 7.54u2

Build 3929

Platform Win32

System Windows XP

I can't seem to locate the Preferences. Where is it located?

Thanks

Link to comment
Share on other sites

erm, tools menu/preferences.

Why dont you upgrade to Opera 8, free upgrade for Opera 7.x users. Opera 8, the problem in Hotmail is fixed.

Link to comment
Share on other sites

Where on the Opera website should I upgrade?

thanks

585874324[/snapback]

uhhh... the download page? :blink:

Link to comment
Share on other sites

Yeah. I was asking whether I just download the whole thing, or if there was an update function. I guess I just download over the top.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.