Bug - Won't Fix Relay browser button doesn't open browser

divergentdave

New member
I recently uninstalled and reinstalled browsers and my relay browser button quit working.

I loaded up KoLmafia (14.1) in jdb, and started stepping through BrowserLauncher.openURL(). It looks like the issue is line 908.
Code:
usingIE = stream.readLine().indexOf( "htmlfile" ) != -1;
Line 908 throws a NullPointerException, which is uncaught and bubbles on out. I ran the command specified above,
Code:
cmd.exe /c assoc .html
and it didn't print anything to stdout, (hence the null pointer) but it did print "File association not found for extension .html" to stderr. I'm not sure why assoc says what it does, because when I double click on an .html file, Firefox opens up just fine.

At any rate, I would recommend replacing line 908 with the following.
Code:
String line = stream.readLine();
usingIE = (line != null) && (line.indexOf("htmlfile") != -1);

Hope this helps, and thanks to all the devs for your hard work.
 

fronobulax

Developer
Staff member
There used to be many reports of problems with the relay browser not opening or not using the system default on a Windows box. I believe the global setting "preferredWebBrowser" was introduced to handle the situation. Does that have any bearing on what you are observing?

Edit: BrowserLauncher came from a different project. It appears that a newer version of that project has been released so the solution would be to assess that version and see whether it should be incorporated or whether mafia forks a local version.
 
Last edited:

divergentdave

New member
Yes, setting preferredWebBrowser works.

It seems that mafia has already forked a local version. Shwei made dozens of revisions back in 2007-2008.
 

Veracity

Developer
Staff member
It seems that mafia has already forked a local version. Shwei made dozens of revisions back in 2007-2008.
Huh?

This is one of the strangest statements I have ever seen regarding the KoLmafia source code. Any and all changes that "Shwei made ... back in 2007-2008" have been in the official source tree since 2007-2008.

Would you care to elaborate and explain just what you mean by "forking a local version"? On the face of it, it's a pretty darn offensive comment. I hope you have an explanation which eliminates that impression.
 

divergentdave

New member
I'm sorry that I was unclear. I meant that according to mafia's SVN history, Shwei edited BrowserLauncher.java back in 2007-2008. So, while BrowserLauncher.java originally came from an external project, KoLmafia as a project has since added additional changes. I was responding to fronobulax's question in his above post, indicating that KoLmafia is already using a customized version of BrowserLauncher.java.

Please accept my apology, and let me know if this clears things up.
 
Top