MozillaZine

Phoenix Refuses to Start After Editing general.useragent.ove

Talk about add-ons and extension development.
itodd

User avatar
 
Posts: 29
Joined: November 19th, 2002, 10:41 pm
Location: Central Massachusetts

Post Posted November 21st, 2002, 8:39 pm

I am authoring a Phoenix Extention and am almost done. One last bug to kill, but it's a nasty one (to me). My extention does one thing and does it well. It toggles Phoenix's user agent based on the state of a checkbox.

I set the useragent like so:
pref.setCharPref('general.useragent.override', 'new agent');

But if I quit phoenix, phoenix will no longer start, spewing the error:
INTERNAL ERROR on Browser End: Expected a version > 5! Version = 0
System error?:: No such file or directory

However, if I revert to the old useragent (before quitting) by using this code:
pref.clearUserPref('general.useragent.override');

it will start again.

Thanks

alanjstr
Moderator

User avatar
 
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here

Post Posted November 21st, 2002, 9:36 pm

Do you write out to prefs.js?

itodd

User avatar
 
Posts: 29
Joined: November 19th, 2002, 10:41 pm
Location: Central Massachusetts

Post Posted November 21st, 2002, 9:50 pm

Write out to prefs.js? I am new to writing extentions and dont' really know what you're asking. Why would I write out to prefs.js?

itodd

User avatar
 
Posts: 29
Joined: November 19th, 2002, 10:41 pm
Location: Central Massachusetts

Post Posted November 22nd, 2002, 11:13 am

It seems that phoenix Checks for Mozilla/5.0 in the user agent string before starting. I need a way to prevent this. Someone suggested to register a close event listener but the best I could find documentation on was an unload listener which doesn't help me.

alanjstr
Moderator

User avatar
 
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here

Post Posted November 22nd, 2002, 11:17 am

itodd wrote:Write out to prefs.js? I am new to writing extentions and dont' really know what you're asking. Why would I write out to prefs.js?


Well, if I wanted to manually change my agent string, I would put it in user.js.

There are other extensions that change the UA string. Have you looked at how they do it?

itodd

User avatar
 
Posts: 29
Joined: November 19th, 2002, 10:41 pm
Location: Central Massachusetts

Post Posted November 22nd, 2002, 1:00 pm

I've looked at how they do it (I based my extention on uabar). They also suffer fromt he same bug. Using uabar, select Mozilla/4.78 and then restart. You get the same error.

LayZ
 
Posts: 137
Joined: November 5th, 2002, 5:07 am

Post Posted November 23rd, 2002, 11:44 am

Is this something to do with the Java plugin? I know Mozilla would refuse to start with a MSIE or non Mozilla/5.0 user agent string if the java plugin is installed.

I've not tried this in phoenix though

itodd

User avatar
 
Posts: 29
Joined: November 19th, 2002, 10:41 pm
Location: Central Massachusetts

Post Posted November 25th, 2002, 11:16 am

Yes, this does have something to do with the java plugin. If iI unlink it, phoenix will start regardless of the user agent string. Quite odd. Anyone know a workaround?

alanjstr
Moderator

User avatar
 
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here

Post Posted November 25th, 2002, 12:22 pm

itodd wrote:Yes, this does have something to do with the java plugin. If iI unlink it, phoenix will start regardless of the user agent string. Quite odd. Anyone know a workaround?


Try bugzilla.

itodd

User avatar
 
Posts: 29
Joined: November 19th, 2002, 10:41 pm
Location: Central Massachusetts

Post Posted November 25th, 2002, 12:41 pm


Return to Extension Development


Who is online

Users browsing this forum: No registered users and 1 guest