Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My ISP injects JavaScript files - most notabily bmi.js - and certain other unwanted additions to web requests when tethering from my phone.

It would be OK if the JavaScript was useful, but it is programmed terribly - and as a JavaScript developer, this really annoys me when the injected scripts break my own work! It looks like it annoys some other people too...

I'd like to block any activity to the IP address 1.2.3.*. I've noticed 1.2.3.4 and 1.2.3.8 in use, or if anyone can give me any better solutions, I'd be happy to try.

Thanks!

EDIT

I have to agree with George Edison with That sounds like a terrible ISP. The plot thickens ... while playing around with iptables and the like, I noticed that as soon as I blocked 1.2.3.4, the script was simply injected from another domain. I blocked that, it moved on to another.

In my web browser, I can access the script from ANY DOMAIN! What the heck is the ISP doing here? For example, these URIs all respond with the script:

  • http://1.2.3.4/bmi-int-js/bmi.js
  • http://1.2.3.5/bmi-int-js/bmi.js
  • http://4.3.2.1/bmi-int-js/bmi.js

and nauseatingly:

  • http://ScriptInjection-WhyDoYouExist.com/bmi-int-js/bmi.js
  • http://google.com/bmi-int-js/bmi.js
  • http://askubuntu.com/bmi-int-js/bmi.js

face palm

share|improve this question
4  
That sounds like a terrible ISP. –  Nathan Osman Oct 4 '11 at 20:33
    
What phone are you using? –  Nathan Osman Oct 4 '11 at 20:40
    
Both my old Nokia E72 and new Nokia E6 did this. The ISP is Virgin Mobile (UK), and I am under the impression that it's o2's fault for implementing this feature in their data centres, which is wholesaled to Virgin. –  Greg Oct 5 '11 at 8:52

3 Answers 3

In Firefox NoScript add-on open Options > Advanced > ABE, USER ruleset, then add:

Site */bmi.js
Deny INCLUSION(SCRIPT)

Of course you can also use regular expressions, and combine multiple URL patterns in the same rule.

You can find more info here: http://noscript.net/abe.

share|improve this answer

The page you linked to in your question contains the following comment:

I have found a solution! :D
On your iPhone go to Settings > General > Network > Cellular Data Network
Then Under “Cellular Data” change the APN to “mobile.o2.co.uk”
And change the Username to “bypass” (no quotes in both cases)
Then save the settings and restart your iPhone and the bmi.js file should no longer show up while tethering. Leaving you with full resolution browsing! The iPhone browser also appears a lot better since it was also affected by the js file.

share|improve this answer
2  
Well, the problem might be that Greg doesn't have an iPhone... what then? :) –  jrg Oct 4 '11 at 21:20
    
@jrg: I asked him (see my comment above) but I haven't heard anything back yet. –  Nathan Osman Oct 4 '11 at 21:52
    
@GeorgeEdison I linked to three pages, not all of them were iphone users, not all of them were o2 users. –  Greg Oct 5 '11 at 9:01

aim your web browser @ 1.2.3.50 and you'll be able to turn off image compression which will remove that annoying javascript injection (worked on t-mobiles network anyway)

if that does not work, use adblock for firefox/chrome to blacklist the bmi.js file

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.