Is M1 broadband injecting Javascript into my web pages?

24 04 2008

Recently on all the web pages that I surf on my PC, I have been seeing blurred images instead of the normally clear ones. I almost went to have my eyes checked, but turns out that it was due to a mysterious chunk of Javascript has been injected at the bottom of every web page that I visit. It’s frustrating because not only the images are blurred, some of the web pages are even broken and inaccessible due to the injected Javascript.

Well, how blur is blur? The first image is the original clear image:

and the following image is the one dished out by M1 and what I saw on my browser:

[ Start of technical paragraph. Feel free to skip this paragraph if it makes you giddy :) ]
When I view the source of the HTMLs, I notice a chunk of Javascript being injected at the bottom of every web page that I visit. This injected Javascript is extremely intrusive because it replaces all the images on web pages with compressed version of the images (for techies who are interested, I’ve listed this Javascript in its entirety at the bottom of this post). I did a further check at the University of Washington Web Integrity Checker and confirmed that the web pages has indeed been modified in transit after leaving the server and while on the way to my computer.

The question is: who is sneakily injecting Javascript into my web pages to replace all the images with the compressed and blurred versions?

My first suspect is naturally my ISP, M1 Broadband. As a simple test, I disconnected my notebook from M1 and connected to Wireless@SG instead. The problem disappeared! The images shown on web pages are the clear ones! I then connected my notebook back to M1 broadband, and the images are blurred again.

So on two occasions within 22 and 23 April 2008, I called up M1 Broadband technical support to inquire if they are purposely compressing all the images at their gateway. On both occasions, the technical support guy’s answer is a firm “No”, regardless of how hard I tried to reason with them. Sensing that these guys might be unaware of this issue themselves, I thanked them and hung up. Just before writing this blog entry, I sent an email to M1 to relate my problem again. Hopefully I can receive a better written reply from there.

If you’re using M1 Broadband and have been facing the same problem too for the past week or so, do leave a comment here. Thanks!

For techies who are interested, here is the injected Javascript in its entirety:

<SCRIPT LANGUAGE=”JavaScript”>
var ir_t;
var ir_g;
var ir_y;
var ir_u;
var mp;
var ir_find=new Array(’.gif’,’.GIF’,’.jpg’,’.JPG’,’.jpeg’,’.JPEG’);

function ir_r()
{
if(!ir_g.dontfetch)
{
if(ir_g.src.search(”mhtml”) != -1)
{
mp = ir_g.src.search(”!”);
if(mp != -1)
{
ir_g.src=ir_g.src.substring(mp+1);
}
}

ir_g.src=ir_g.src+’nguncompressed’;
}

ir_g.dontfetch=true;
ir_g.updateSrc=true;
ir_g.title = ir_g.oldTitle;
ir_g.alt = ir_g.oldAlt;
window.status=”;

}

function ir_c(event)
{
if(! event)
event = window.event;

lTargetTag = (null != event.srcElement) ? event.srcElement : event.target;

if(lTargetTag)
{
if(lTargetTag.tagName==”IMG”)
{
ir_g=lTargetTag;
if(!ir_g.dontfetch && !ir_g.updateSrc && !ir_y)
{
if(!ir_g.changeAlt)
{
ir_g.oldTitle = ir_g.title;
ir_g.title = ”;
ir_g.oldAlt = ir_g.alt;
ir_g.alt = ”;
ir_g.changeAlt = true;
}
window.status = ”;
ir_t=setTimeout(”ir_r();”, 1000*2);
}
}
}
}

function ir_e()
{
clearTimeout(ir_t);
window.status=”;
}

function ir_d(event)
{
if(! event)
event = window.event;

if(!ir_u && event.keyCode == 38 )
{
ir_u=true;
ir_y=true;
for (i = 0 ; i < document.images.length ; i++)
{
if(!(document.images[i].updateSrc))
{
for (j = 0 ; j < ir_find.length ; j++)
{
if((document.images[i].src).search(ir_find[j]) != -1)
{
if((document.images[i].src).search(”mhtml”) != -1)
{
mp = (document.images[i].src).search(”!”);
if(mp != -1)
{
(document.images[i].src)=(document.images[i].src).substring(mp+1);
}
}
document.images[i].src=document.images[i].src+’nguncompressed’;
break;
}
}
}
}
}

}

for (i = 0 ; i < document.images.length ; i++)
{
ir_y=false;
var lOnMouseOver = document.images[i].onmouseover;
if (lOnMouseOver == null)
{
for (j = 0 ; j < ir_find.length ; j++)
{
if((document.images[i].src).search(ir_find[j]) != -1)
{
document.images[i].onmouseover=ir_c;
break;
}
}
}
};

for (i = 0 ; i < document.images.length ; i++)
{
var lOnMouseOut = document.images[i].onmouseout;
if (lOnMouseOut == null)
{
document.images[i].onmouseout=ir_e;
}
};

</SCRIPT>


Actions

Information

17 responses to “Is M1 broadband injecting Javascript into my web pages?”

24 04 2008
Buds (08:35:20) :

Hi,

I’m an M1 Broadband user and I’ve been having the same problem with blurry images on my browser. I hope a solution will be provided soon.

best regards,
Buds

24 04 2008
singchyun (11:54:46) :

HI Buds, thanks for leaving your comments.

I’ve just called M1 tech support for the third time. Thankfully this time round, they are willing to investigate by asking me to send them some screenshots. Will update in this blog once I receive any answer from M1. Thanks.

24 04 2008
Ben (16:20:35) :

I also experience the same thing, all the images seem to be compressed. First I thought it was my web browser’s mistake but when I swap from IE to Firefox, the same problem persists; so I’m sure the reason is because the javascript you mentioned (I have it too).

Hope they can solve it soon.

Thanks for telling us Sing Chyun.

24 04 2008
singchyun (17:11:00) :

Hi Ben, welcome and thanks for your comments.

I wrote this entry so that others can be saved from the same frustration that I faced. I had scanned my entire computer for malware and viruses, restarted my computer, cleared my browsers’ cache repeatedly, but the problem still persisted. I had even thought of re-formatting my whole computer! :P Ha ha.

24 04 2008
spycampers (18:24:58) :

i have the same problem too…
my email is finalsquall@hotmail.com//

anyone have solution??

24 04 2008
spycampers (18:27:04) :

btw.. the tech support told me that mouse over will make the pic clear again.
u got try???

finalsquall@hotmail.com

24 04 2008
singchyun (18:57:37) :

Hi spycampers,

Unfortunately there are no solutions yet.

Time now is 6:56pm, 24 Apr 2008. I’ve not received any acknowledgement from M1 yet. They have not contacted me since I spoke with them and emailed them the screenshots this morning at 10:42am. Sadly, after 8 hours, they still hadn’t tell me if it’s their fault or not.

Yes, I have tried. Mousing over the particular blur image will cause the clear image to be fetched and displayed. But I hardly consider it as a solution at all. Does M1 expect us to surf the web this way, mousing over each and every image ?? :)

24 04 2008
jjm (21:36:57) :

Hi All,
I am also facing the same problem… I reformatted my system some days back, after that only i noticed this problem so i thought something went wrong during the installation.. i was about to reformat the system again… Thanks singchyum for this post…. I think M1 itself is doing the javascript intrusion to reduce their network traffic as they cannot handle the load.

thanks & Regards

24 04 2008
spycampers (23:06:27) :

wat M1 is doing huh?? anyway… some picture.. mouse over also not use one..
if u really want to open the pics..
must open as another window
and behind put as ngcompressed

example
I have try open a pics let said 123.jpg
it give me a blur pics.
I try again by putting “nguncompressed” behind the filename like this

123.jpgnguncompressed

it will give a clear pics…
stupid right

24 04 2008
singchyun (23:59:58) :

Hi, jjim is correct. The purpose of serving out compressed (that is, blur) images is to reduce network traffic.

If M1 is really doing this, then I find it naive and unethical, because instead of upgrading their infrastructure to cope with the load, M1 is sacrificing their customers by sending them blur images in order to reduce the network traffic.

Btw, at 7:36pm, my morning email to M1 is finally acknowledged by someone from M1 Customer Relations. In his email, he mentioned that they are currently checking with the relevant department and will keep me informed of the outcome.

Unfortunately in his email, this M1 Customer Relations officer did not reveal his email address; he reminded me not to reply to the unmanned email address that he sent from, and that I should again send my feedback at http://csfeedback.m1.com.sg/jsp/email.jsp if I have further queries.

25 04 2008
samwize (00:00:13) :

This is ridiculous from M1! Reducing their bandwidth and sacrificing us? Next they will extract only keyframes from youtube videos..

I faced problem on mobile surfing and blogged it here. At least on mobile we can change to another AP.. but that is not my solution either!

25 04 2008
singchyun (00:35:55) :

Hi samwize, yes, it’s really silly and incredible. :)

Thanks for blogging about the buggy M1 Mobile Surf at your blog:

http://www.just2me.com/2008/04/m1-mobilesurf-is-mobilesotong.html
http://www.just2me.com/2008/04/part-2-to-m1-mobile-sotong-surf.html

I suspect this blur image problem is related to M1 Mobile Surf.

25 04 2008
25 04 2008
spycampers (19:52:50) :

sad la… overall no solution…

30 04 2008
anony (10:44:29) :

// ==UserScript==
// @name m1ImgFix
// @namespace me
// @description m1 bb blur image fix for greasemonkey script (firefox) or user script (ie7pro)
// @include *
// ==/UserScript==

window.setTimeout(
function() {
for(i=0 ; i<document.images.length; i++) {
sImg=document.images[i].src;
if( sImg.match(/^mhtml:/i) ) {
mp=sImg.search(’!');
if( mp!=-1 ) {
sImg=sImg.substring(mp+1);
}
}

if( !sImg.match(/\.(gif|jpg|jpeg)nguncompressed$/i) ) {
document.images[i].src=sImg+’nguncompressed’;
}
}; //for i
} //fn
, 1000);

5 05 2008
spycampers (14:06:50) :

how to run this script?

5 05 2008
anony (17:31:05) :

m1 bb blur image fix v0.03

for firefox users:
install greasemonkey addon from http://www.greasespot.net/
download script from http://www.badongo.com/file/9153791
uninstall previous version of this script (if any).
drag script and drop in firefox window to install.

for ie7 users:
install ie7pro addon from http://www.ie7pro.com/
download script from http://www.badongo.com/file/9153792
uninstall previous version of this script (if any).
drag script and drop in ie7 window to install.

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>