With Firefox upgrading their browser so often it is "breaking" the plugins. Luckily, the fix is easy. Find the install.rdf file for the individual plugin in the extensions folder (%userprofile%\AppData\Roaming\Mozilla\Firefox\Profiles\somefolder.default\extensions\specificplugin), and update the em:maxVersion attribute to the current version, or if you are feeling real lucky, just change the value to *. The RDF file is nothing but an XML file.
You need to make sure you are in the right node of the xml file before making changes because mulitple products can be defined. The em:id of {ec8030f7-c20a-464f-9b0e-13a3a9e97384} is the Firefox identifier. The em:maxversion needs to be checked/updated.
Thanks Shane. This would work for properly formated xml files. Unfortunately, I have at least one example where the file is one long line . Sorry I didn't mention it before.
It's so funny to me how I remember XML was the future... and how little it seems to be used, at least in a scripting environment.
#202612 - 2011-07-0811:17 PMRe: Help with XML
[Re: Allen]
ShaneEPShaneEP MM club member
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Well...making a bit of progress. Still trying to figure out how to differentiate one maxVersion from the others though since they are all lumped under the same em:...
I did get this to change the maxVersion value though!
Man what a pain. I had this all but working. The em:maxVersion kept coming up with the wrong value, and I couldn't figure out why until I actually counted how many were in the xml file. There is one more em:id than there are em:maxVersion's. Once I got that straight, I think I finally got it. Here is where I am now... still working on it, but progress
Code:
break on
$RC=setoption("WrapAtEOL","ON")
$FireFoxVersion="5.0"
$objXMLDoc = CreateObject("Microsoft.XMLDOM")
$objXMLDoc.async = False
$RC=$objXMLDoc.load(@scriptdir + "\install (2).rdf")
$x=$objXMLDoc.documentElement.selectNodes("Description/em:targetApplication/Description")
for $i=0 to $x.length
if $Objxmldoc.getelementsbytagname("em:id").item($i).text="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
? "Firefox"
? $Objxmldoc.getelementsbytagname("em:maxVersion").item($i-1).text
? $Objxmldoc.getelementsbytagname("em:id").item($i).text
if $Objxmldoc.getelementsbytagname("em:maxVersion").item($i-1).text<>$FirefoxVersion
? "saving"
$Objxmldoc.getelementsbytagname("em:maxVersion").item($i-1).text=$FirefoxVersion
$objxmldoc.save(@scriptdir + "\changed.xml")
endif
endif
next
Oh sweet... I just found a nice side effect. I tested this on the file that was poorly formatted and it worked, AND the new file is now properly formatted.
Have you noticed there a like 10 different xml objects you can use? I was so confused and not sure which to use. Some examples used one way, some used others. The best docs I found were for XMLDOM though...
#202624 - 2011-07-0911:38 PMRe: Help with XML
[Re: Allen]
ShaneEPShaneEP MM club member
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Looks good Allen...Just one thing...
Code:
if $Objxmldoc.getelementsbytagname("em:maxVersion").item($i-1).text<>$FirefoxVersion
$Objxmldoc.getelementsbytagname("em:maxVersion").item($i-1).text=$FirefoxVersion
Should maybe be...?
Code:
if $Objxmldoc.getelementsbytagname("em:maxVersion").item($i-1).text<>$Version
$Objxmldoc.getelementsbytagname("em:maxVersion").item($i-1).text=$Version
Didn't see the $version parameter in the UDF called on anywehre.
Well Hell!!! Firefox 7 breaks my updater already. I think I got to use it for version 5 and 6... and now even though I have updated the addons for ver 7, it says they are all unsupported.
I'll be looking for a way to do this again, if anyone has suggestions.