Fatal Syntax Error bug with Firefox 12 [FIXED]

Any feedback, suggestion, bug reports, problems....
Locked
Shimapan
Posts: 3
Joined: Sat Apr 14, 2012 5:03 pm

Fatal Syntax Error bug with Firefox 12 [FIXED]

Post by Shimapan » Sat Apr 28, 2012 10:42 pm

There's a fatal Syntax Error bug with the latest Flagfox 4.1.14 on Firefox 12.
I already tried uninstalling Flagfox, restarting FF, reinstalling Flagfox and restarting FF again, but it does nothing to fix this issue, it remains the same.

------------------------------------------------------------
FLAGFOX VERSION: 4.1.x (missing IPDB!)

ERROR MESSAGE: Fatal Flagfox startup error!

EXCEPTION THROWN: SyntaxError: JSON.parse: bad control character in string literal

STACK TRACE:
()@resource://flagfox/flagfox.jsm:160
startup()@resource://flagfox/flagfox.jsm:84
([object Proxy])@resource://flagfox/flagfox.jsm:146
Flagfox_loadForThisWindow([object Event])@chrome://flagfox/content/overlay.xul:16

BROWSER: Mozilla Firefox 12.0 (Gecko 12.0 / 20120423122928)
OS: Linux x86_64 (Linux x86_64-gcc3 gtk2)
LOCALE: de content / de UI / de-de OS
------------------------------------------------------------

User avatar
DaveG
Flagfox Developer
Posts: 723
Joined: Wed Oct 03, 2007 9:06 pm
Location: Philadelphia, USA

Re: Fatal Syntax Error bug with Firefox 12

Post by DaveG » Sat Apr 28, 2012 11:18 pm

Thank you for reporting this. This is the first time I've heard of this error message. Basically it's choking on your saved Flagfox actions settings for some reason. Either your Firefox user preferences file has been corrupted somehow, there's a bug in Mozilla's internals that allows invalid characters to be saved but not loaded, and/or I need to be parsing things to be saved more carefully.

First off, have you added any custom actions to Flagfox? If so, did you create it yourself or get it from the forums? Also, have you enabled/disabled any built-in actions in the list, reordered actions, or changed a keyboard or mouse shortcuts?

If you can get a working preferences dump I can read the specifics from that, and if it's not broken too then it should be easy to get. When Flagfox puts up an error dialog, it also dumps its loaded preferences to the Firefox Error Console. You can open it by clicking the Firefox button or Tools in the classic menu and clicking its menu entry in the Web Developer sub-menu. Click the Errors button up top and find the one entry starts with "Error: Flagfox PREFERENCES DUMP" in the list. Right-click on it, copy it, and paste it here so I can see what's wrong in it that Firefox's JSON parser can't deal with so I can fix it.

Shimapan
Posts: 3
Joined: Sat Apr 14, 2012 5:03 pm

Re: Fatal Syntax Error bug with Firefox 12

Post by Shimapan » Sun Apr 29, 2012 1:18 am

I haven't created any custom actions for Flagfox. The actions should be the default.
Here are the Preferences from the Error Console. Hope that helps you to find the bug.

Fehler: Flagfox PREFERENCES DUMP:
flagfox.actions=[{"name":"Geotool","template":"http://geoip.flagfox.net/?ip={IPaddress ... ods":"ctrl alt","key":"g"},"show":true},{"name":"WolframAlpha","template":"http://www.wolframalpha.com/input/?i={d ... name":"WOT Scorecard","template":"http://www.mywot.com/scorecard/{domainN ... ame":"Same IP","template":"http://sameip.org/ip/{IPaddress}"},{"na ... e":"Google
Cache","template":"http://www.google.com/search?q=cache:{f ... e":"Google Translate","template":"http://translate.google.com/translate?t ... :"Internet Archive","template":"http://web.archive.org/web/*/{fullURL}"},{"name":"W3C Validator","template":"http://validator.w3.org/check?uri={full ... name":"W3C CSS Validator","template":"http://jigsaw.w3.org/css-validator/vali ... ame":"WAVE a11y Check","template":"http://wave.webaim.org/report?url={full ... name":"SSL Checker","template":"http://www.sslshopper.com/ssl-checker.h ... e":"Header Check","template":"http://quixapp.com/headers/?r={fullUrl}"},{"name":"URL Parser","template":"http://urlparser.com/?linkFrom=flagf1&u ... nName}&o=2","
show":true},{"name":"Traceroute","template":"http://www.domaintools.com/research/tra ... "name":"It down or just me?","template":"http://downforeveryoneorjustme.com/{dom ... "name":"My Info","template":"http://geoip.flagfox.net/","show":true},{"name":"bit.ly URL","template":"http://bit.ly/?v=3&u={fullUrl}","show": ... ame":"Tiny URL","template":"http://tinyurl.com/create.php?url={full ... ame":"Copy IP","template":"copystring:{IPaddress}","show":true},{"name":"Copy Server Info","template":"copystring:{domainName} ({IPaddress}) - {countryName} ({countryCode})"},{"name":"Wikipedia: Country","template":"http://{baseLocale-UI}.wikipedia.org/wiki/Special:Search?search={countryName}&go=Go&variant={locale-UI}"},{"name":"Wikipedia: Domain","template":"http://{baseLocale-UI}.wikipedia.org/
wiki/Special:Search?search={baseDomainName}&go=Go&variant={locale-UI}"},{"name":"Wikipedia: TLD","template":"http://{baseLocale-UI}.wikipedia.org/wiki/Special:Search?search=.{TLD}&go=Go&variant={locale-UI}"},{"name":"Page Metadata","template":"javascript:msg=\"Title: {title}\"; [[\"Section\",\"{meta-section}\"],[\"Subsection\",\"{meta-subsection}\"],[\"Author\",\"{meta-author}\"],[\"Creator\",\"{meta-creator}\"],[\"Publisher\",\"{meta-publisher}\"],[\"Description\",\"{meta-description}\"],[\"Keywords\",\"{meta-keywords}\"],[\"Generator\",\"{meta-generator}\"],[\"Robots\",\"{meta-robots}\"],[\"Viewport\",\"{meta-viewport}\"]].forEach(function(info){if(info[1])msg+=\"\\n\\n\"+info[0]+\": \"+info[1]}); alert(msg);"}]
flagfox.hasshownFirefox3dot5EOLwarning=false
flagfox.openlinksin=tabFG
flagfox.showfavicons=true
flagfox.usealticons=false
flagfox.warn.proxy=enabled
flagfox.warn.stale=enabled
flagfox.warn.tld=enabled

User avatar
DaveG
Flagfox Developer
Posts: 723
Joined: Wed Oct 03, 2007 9:06 pm
Location: Philadelphia, USA

Re: Fatal Syntax Error bug with Firefox 12

Post by DaveG » Sun Apr 29, 2012 5:27 pm

Just to make sure, you didn't modify the dump you posted at all, even pressing enter on a line to create a line break?

Based on the dump, you have in your settings the following changes from default:
1) You've seen and asked to see again the TLD mismatch notice
2) The Alexa action has been hidden from the menu
3) The Google Translate action has been hidden from the menu and moved down one position in the ordering
4) The Traceroute optional default action has been added to the menu

The first has its own pref. The rest are all stored in the one JSON pref for all actions settings which is what's broken. If you haven't even accidentally added a line break, then I have no idea how that happened at the moment. That appears to be what the JSON parser is choking on. There's 3 line breaks in odd places in the pref, which apparently makes it invalid.

You can fix your settings by opening a new Firefox tab, typing "about:config" into the address bar (without the quotes), hitting enter, click the button to get past the warning, type "flagfox" into the search bar in the page (without the quotes), right clicking on the bold line with "flagfox.actions" in the name column, and selecting "reset". Restart Firefox to make sure it loads up fine and check to make sure the right-click menu for Flagfox is back to normal. It'll only be a couple extra clicks in the Flagfox options to restore your changes that I listed above. (your TLD notice setting will not be affected)

I'm really curious as to what corrupted the pref. Have you manually edited prefs.js recently? Is there any "system cleaner" software you've run? (these have broken things in the past)

In any case, I guess I'll need to come up with a way for Flagfox to fix this automatically if this happens to someone else, which should be simple enough.

User avatar
DaveG
Flagfox Developer
Posts: 723
Joined: Wed Oct 03, 2007 9:06 pm
Location: Philadelphia, USA

Re: Fatal Syntax Error bug with Firefox 12

Post by DaveG » Sun Apr 29, 2012 6:24 pm

Ok, I've written it so that Flagfox will be able to repair this problem if it sees it. It'll send a message to the error console about it but won't complain in a popup. This change will be included in the next Flagfox monthly update.

Thanks for reporting this and giving me enough information to work with. Once the update is out this shouldn't happen for anyone anymore. It would still be nice to know how this is happening if you have any detail you can add (see previous reply).

Shimapan
Posts: 3
Joined: Sat Apr 14, 2012 5:03 pm

Re: Fatal Syntax Error bug with Firefox 12

Post by Shimapan » Tue May 01, 2012 11:01 pm

No, I haven't inserted any additional line breaks or anything. I've copy&pasted it verbatim from the error dialog.
All I ever have used FlagFox for is displaying the flag. I haven't ever used any of the actions.

Anyway, I've reset the preferences in "about:config", and it works fine again now.

Locked