<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Erxin, Shang(Edwin, 尚尔鑫)&#039;s Home Page &#187; Autoit</title>
	<atom:link href="http://www.shangerxin.com/?feed=rss2&#038;tag=autoit" rel="self" type="application/rss+xml" />
	<link>http://www.shangerxin.com</link>
	<description>Knowledge should be free.</description>
	<lastBuildDate>Tue, 24 Aug 2021 02:27:23 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8.13</generator>
	<item>
		<title>Automatic Export About:Config Content Compare the Difference between for Firefox</title>
		<link>http://www.shangerxin.com/?p=262</link>
		<comments>http://www.shangerxin.com/?p=262#comments</comments>
		<pubDate>Wed, 02 Dec 2015 03:24:07 +0000</pubDate>
		<dc:creator><![CDATA[Shang Erxin]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Autoit]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.shangerxin.com/?p=262</guid>
		<description><![CDATA[Requirement: We need to compare the difference between the configuration changes between the new vision of the FF and the previous version We wish to compare the configuration setting in plain text. Then we could use the compare tools such as beyond compare or winmerge to give us a quick visual for the difference. The [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Requirement:</strong></p>
<p>We need to compare the difference between the configuration changes between the new vision of the FF and the previous version</p>
<p>We wish to compare the configuration setting in plain text. Then we could use the compare tools such as beyond compare or winmerge to give us a quick visual for the difference.</p>
<p><strong>The Problem:</strong></p>
<p>There is not a official way to export the <a href="http://aboutconfg">about:confg</a> page from FF into plain text file. There is a <a href="http://kb.mozillazine.org/Prefs.js_file">prefs.js</a> file locate in the firefox profile folder, it contains some of the configuration setting but not all.</p>
<p><strong>Known solutions to export the about:config but not well enough:</strong></p>
<ul>
<li>User prefs.js for only export the custom settings, check the link(<a href="http://superuser.com/questions/165164/how-to-export-firefox-aboutconfig-into-plain-text-file">http://superuser.com/questions/165164/how-to-export-firefox-aboutconfig-into-plain-text-file</a>). But it is not fit for our requirement.</li>
<li>User python to analyze the entire profile folder and parse the preference relative *.js files. But it is not sure works for the new versions of the FF(<a href="http://stackoverflow.com/questions/24548306/how-to-read-firefoxs-aboutconfig-entries-using-python">http://stackoverflow.com/questions/24548306/how-to-read-firefoxs-aboutconfig-entries-using-python</a>)</li>
</ul>
<p><strong>Solution for export the about:config</strong>:</p>
<p>Use the GUI automation tool(<a href="https://www.autoitscript.com/site/autoit/">autoit</a>) to help export the configuration directly from the <a href="http://aboutconfig">about:config</a> page. The script is export-opened-firefox-config.au3 which could be download from <a href="https://github.com/shangerxin/PersontalTools/">my github repot</a></p>
<ol>
<li>Install <a href="https://www.autoitscript.com/site/autoit/">autoit</a>, which double be download from official website follow the previous link</li>
<li>Download the export-opened-firefox-config.au3</li>
<li>Before run the script close all the Firefox process existed in the current system</li>
<li>Run the script export-opened-firefox-config.au3</li>
<li>Open the Firefox that you want to export the about the configure content</li>
<li>The script will start automatically and wait for it stops, please make any user input during the script execution</li>
<li>The output.txt will be generated at the same location of the script file export-opened-firefox-config.au3 which contain all the configuration values</li>
<li>Check the last line of the output.txt contain the last item of the about:config. If the values are same then all is well. If not please modify the sleep time for the script to give more calculate time for the low performance system.</li>
</ol>
<p><strong>Solution for generate the difference compilation results:</strong></p>
<p>Use <a href="https://www.python.org/">python</a> to parse and generate the previous generate configuration files and the current user.js settings which contain in the LR-INSTALL-DIRECTORY\dat\FFProfile\user.js. The python script could be check out from my personal tools <a href="https://github.com/shangerxin/PersontalTools/">repo from github</a></p>
<ol>
<li>Install python 2.7.x, if current system doesn&#8217;t contain python environment</li>
<li>Install <a href="http://www.python-excel.org/">xlsxwriter</a> from pip or download the package install manually. Check this <a href="https://docs.python.org/2/install/index.html">link</a>, if you doesn&#8217;t familiar with python</li>
<li>Download the script</li>
<li>Copy and replace the about config content files and the user.js into the data folder to make it follow this file structure</li>
</ol>
<p><a href="http://www.shangerxin.com/wordpress/wp-content/uploads/2015/12/2015-12-02_110835.png"><img alt="2015-12-02_110835" src="http://www.shangerxin.com/wordpress/wp-content/uploads/2015/12/2015-12-02_110835-300x104.png" width="300" height="104" /></a></p>
<p><a href="http://www.shangerxin.com/wordpress/wp-content/uploads/2015/12/2015-12-02_111617.png"><img alt="2015-12-02_111617" src="http://www.shangerxin.com/wordpress/wp-content/uploads/2015/12/2015-12-02_111617-300x196.png" width="300" height="196" /></a></p>
<p>5. Execute the python script the output files will be overwrite and generated automatically  Note: If the excel file is not required you could common the script lines relative to generate excel to only generate plain text report. The key/value pair is separate by semicolons like this:</p>
<p><a href="http://www.shangerxin.com/wordpress/wp-content/uploads/2015/12/2015-12-02_111832.png"><img alt="2015-12-02_111832" src="http://www.shangerxin.com/wordpress/wp-content/uploads/2015/12/2015-12-02_111832-300x157.png" width="300" height="157" /></a></p>
<p><strong>References</strong></p>
<ul>
<li>A addon for add description information for the <a href="http://aboutconfig">about:config</a> page <a href="https://addons.mozilla.org/en-US/firefox/addon/config-descriptions/">https://addons.mozilla.org/en-US/firefox/addon/config-descriptions/</a></li>
<li>The wiki page for the <a href="http://aboutconfig">about:config</a>, <a href="http://kb.mozillazine.org/About:config_entries">http://kb.mozillazine.org/About:config_entries</a></li>
<li>Some of the preference documents for the <a href="http://aboutconfig">about:config</a>, <a href="http://kb.mozillazine.org/Category:Preferences">http://kb.mozillazine.org/Category:Preferences</a></li>
<li>Document for user.js, <a href="http://kb.mozillazine.org/User.js">http://kb.mozillazine.org/User.js</a></li>
</ul>
<p>Note: the content of the wiki may adapt to the old version of FF to check the new version please follow the link supplied in the wiki pages.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shangerxin.com/?feed=rss2&#038;p=262</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
