Slyck.com
 
Slyck Chatbox - And More

Javascript and Firefox

A place for developers and programmers of file-sharing software to discuss issues.
Forum rules
PLEASE READ BEFORE POSTING: Slyck Forum Rules

Javascript and Firefox

Postby BigWillyStyle42 » Mon Dec 13, 2004 1:12 am

I'm playing around with some Javascript and I've run into a pretty serious performance problem.

Code: Select all
function checkForED2KFile(e)
{
  if(!e) return false;
  if(/^http:\/\//.test(e.originalTarget))
  {
    HTTPrequest = new XMLHttpRequest();
    HTTPrequest.open("GET", e.originalTarget + ".ed2k", false);
    HTTPrequest.send(null);
    if(/^ed2k:\/\//.test(HTTPrequest.responseText))
    {
      e.preventDefault();
      e.stopPropagation();
      edUtil.downloadFile('"' + HTTPrequest.responseText + '"');
    }
  }
}


When HTTPrequest.send(null) is called firefox's CPU usage grows to 100% until the request has its response. In most cases you'd never notice because you'd have the response in less than a second, but if you've got any latency problems with your internet connection you're going to notice almost instantly. I'm wondering if anyone else has come across something like this or knows of a different way of getting a file via Javascript so as to perhaps sidestep this issue entirely.

To see an example you can visit: http://www.bigwillystyle42.com/scripts/index.htm

The one link is for http://www.bigwillystyle42.com/files/mf ... erator.exe so the script will try to download http://www.bigwillystyle42.com/files/mf ... r.exe.ed2k both of which are valid.
BigWillyStyle42
 
Posts: 798
Joined: Mon Sep 29, 2003 8:22 pm
Location: Rockville, MD

Re: Javascript and Firefox

Postby tulipa » Wed Dec 10, 2008 8:26 am

How do I turn Javascript on using Mozilla Firefox? When I go on YouTube, it gives me a message that says you either have Javascript turned off or you have a older version of Flash Player. I've tried going to Tools>Options, but it says Javascript is enabled and still it won't work. Someone help!
tulipa
 
Posts: 1
Joined: Sat Dec 06, 2008 5:24 am

Re: Javascript and Firefox

Postby Monalisa » Fri Jan 30, 2009 6:30 am

Let me check your script first only then i will be able to tell you something
Monalisa
 
Posts: 15
Joined: Thu Jan 29, 2009 6:37 am
Location: UK


Return to Developers Forum

Who is online

Users browsing this forum: No registered users and 0 guests

cron
© 2001-2008 Slyck.com