tag:blogger.com,1999:blog-91156446058333841382024-03-13T21:16:17.380+01:00X de XavierUnos y ceros. A veces, en el orden adecuado.-Xvhttp://www.blogger.com/profile/12954073038736466058noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-9115644605833384138.post-73017729548916926492008-04-15T21:46:00.006+01:002008-04-24T09:16:33.994+01:00A simple way to manage Firefox privilegesIf you are familiar with the 'enhanced abilities' Firefox security prompt, and you ever clicked on the 'Remember this decision' check box<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_T679aggANRU/SAUV47MdTXI/AAAAAAAAAEE/btI4u5w6n4I/s1600-h/securityprompt.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_T679aggANRU/SAUV47MdTXI/AAAAAAAAAEE/btI4u5w6n4I/s400/securityprompt.png" alt="" id="BLOGGER_PHOTO_ID_5189578213321166194" border="0" /></a><br />you may want to check <a href="http://firefoxprivileges.tiddlyspot.com/">http://firefoxprivileges.tiddlyspot.com</a>.<br /><br />When this prompt appears as a result of loading a file from your hard drive, you may not be aware of the exact meaning of the 'Remember this decision' check box. While you probably mean "I trust this file and I don't want you to annoy me anymore", Firefox understands "I trust every html file loaded from the hard drive". This broad trust is not a good idea from the security point of view.<br /><br />This tool allows to easily cancel that effects of "remember this", and tell Firefox that you only trust some specific files (<a href="http://www.mozilla.org/projects/security/components/per-file.html">per-file permissions</a>). Before hacking it, I used to have to mess with the <a href="http://kb.mozillazine.org/User.js_file">user.js</a> file, much less convenient.<br /><br />The tool is implemented as a TiddlyWiki plugin. If you are not familiar with <a href="http://firefoxprivileges.tiddlyspot.com/#TiddlyWiki">TiddlyWiki</a>s (super cool wikis in a single file), this is a good chance to get to know them.<br /><br /><span style="font-weight: bold;">Edit:</span><br /><span style="font-size:78%;">Some strings to make this post googleable for the right people:<br />UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite UniversalFileRead CapabilityPreferencesAccess UniversalPreferencesRead UniversalPreferencesWrite<br />netscape.security.PrivilegeManager.enablePrivilege signed.applets.codebase_principal_support</span>-Xvhttp://www.blogger.com/profile/12954073038736466058noreply@blogger.com0tag:blogger.com,1999:blog-9115644605833384138.post-56874112632067671062007-09-22T11:21:00.000+01:002007-09-22T10:58:04.407+01:00XUL templates and tabs<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.xulplanet.com/"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.xulplanet.com/images/xulplanet.png" alt="" border="0" /></a><br />I had some problems using <a href="http://www.xulplanet.com/tutorials/xultu/templates.html">XUL templates</a> to populate <a href="http://www.xulplanet.com/tutorials/xultu/tabpanel.html">a tabbox</a> using a RDF data source: the tabs were created, but switching tabs did not work. Avoiding the use of inline templates and <a href="http://www.xulplanet.com/ndeakin/archive/2003/10/1/">moving the template outside of the tabbox element</a> solved this. Looks like the tabbox was confused by the <tabs> and <tabpanels> elements inside the <template> node.<br /><div style="overflow:scroll"><pre><code><br /><template id="tabTemplate"><br /> <tabs><br /> <tab uri="rdf:*" label="rdf:http://multirunner.blah/rdf#name"/><br /> </tabs><br /> <tabpanels><br /> <tabpanel uri="rdf:*"><br /> <label value="rdf:http://multirunner.blah/rdf#name"/><br /> </tabpanel><br /> </tabpanels><br /></template> <br /><tabbox id="rdftabbox" <br /> datasources="rdftabs.rdf" <br /> ref="http://multirunner.blah/tabs" <br /> template="tabTemplate" /> <br /></code></pre></div>-Xvhttp://www.blogger.com/profile/12954073038736466058noreply@blogger.com1tag:blogger.com,1999:blog-9115644605833384138.post-70210677744317020972007-08-06T16:30:00.000+01:002007-09-22T10:53:09.140+01:00XUL persist annoyancesXUL Elements have <a href="http://www.xulplanet.com/references/elemref/ref_XULElement.html#attr_persist">a persist attribute</a>, that is documented as<blockquote>A space separated list of attributes that are maintained when the window is closed. When the window is re-opened, the values of persistent attributes are restored. In Mozilla, persistent attributes are stored in the per-profile file localstore.rdf. Persistence can also be stored using the document.persist function. In order for persistence to work, the element must also have an id.</blockquote> I've learned some things about it today:<br /><ul><li>It does not seem to work for the "value" attribute of "textarea" elements</li><li>It is stored as <a href="http://www.xulplanet.com/tutorials/mozsdk/rdfstart.php">RDF</a><br /></li><li>It asks for some quite verbose code if you need to access to it<br /></li></ul><div style="overflow:scroll"><pre><code><br />var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].<br /> getService(Components.interfaces.nsIRDFService);<br />var rdfLocalStoreDS = Components.classes["@mozilla.org/rdf/datasource;1?name=local-store"].<br /> getService(Components.interfaces.nsIRDFDataSource);<br />var rdfRes = rdfService.GetResource("uri of interest after about in localstore.rdf");<br />var screenXRes = rdfService.GetResource("screenX");<br />var screenYRes = rdfService.GetResource("screenY");<br /><br />if (rdfLocalStoreDS.hasArcOut(rdfRes, screenXRes) &&<br />rdfLocalStoreDS.hasArcOut(rdfRes, screenYRes)) {<br />var screenX = rdfLocalStoreDS.GetTarget(rdfRes, screenXRes, true).<br /> QueryInterface(Components.interfaces.nsIRDFLiteral)<br />var screenY = rdfLocalStoreDS.GetTarget(rdfRes, screenYRes, true).<br /> QueryInterface(Components.interfaces.nsIRDFLiteral)<br />window.moveTo(screenX.Value, screenY.Value);<br /></code></pre></div>I failed to call <code>QueryInterface(Components.interfaces.nsIRDFLiteral)</code> for quite a while of wasted time. In <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=391044#c2">another piece of code that I wrote</a>, this was magically called for me by checking <code>if (target instanceof Components.interfaces.nsIRDFLiteral);</code> I need to get a better understanding of Mozilla's component model mechanisms... I also failed to use "Value" with a capital letter, to add up to the waste. :-(-Xvhttp://www.blogger.com/profile/12954073038736466058noreply@blogger.com0tag:blogger.com,1999:blog-9115644605833384138.post-36171151279229827012007-08-02T13:37:00.000+01:002007-08-06T08:53:42.199+01:00Upcoming DanceLikeMattHardingWare (half cooked hacks)I have a longish backlog of hacks worth cleaning up and publishing<br /><ul><li><span style="font-weight: bold;">FoxyHistory</span>, a better Firefox History Manager. Having the ability to include urls when searching, and to sort the history by date of first visit has already saved me some time trying to restore some foggy memories.<br /></li><li><span style="font-weight: bold;">TiddlyWiky SendTo Shortcuts</span>, that allow to easily create customized links to files in a tiddlywiki and tiddlers with the contents of a file <span style="font-size:85%;">(Thanks for that <a href="http://groups.google.com/group/TiddlyWiki/browse_frm/thread/fa8a27d2f13f94fd/e26f38c207160ceb?#e26f38c207160ceb">first implementation</a>, <a href="http://groups.google.com/groups/profile?enc_user=cfb74xEAAADNzp8KVNaUwGY7xBgmxhfBIZ6HvvJW0y4Pue0pYgAOJQ">-- F.</a>!)</span><br /></li><li><span style="font-weight: bold;">MultiTiddlyWiki</span>, that allows to have a bunch of tiddlywikis in a single Firefox tab. Specially nice when used with the terrific <a href="http://wiki.mozilla.org/WebRunner">WebRunner</a>, a XULRunner based <a href="http://www.hawkwings.net/2006/05/13/a-dedicated-distraction-free-browser-for-gmail/">distraction-free browser</a> <span style="font-size:85%;">(Thanks for <a href="http://groups.google.com/group/GTD-TiddlyWiki/browse_frm/thread/c7a877fbd76a4363">the link</a>, <a href="http://groups.google.com/groups/profile?enc_user=EZKFZB4AAAAiViFfWiEmN7zhal_9mEZS3PARwrFCXyGvkdrowEPjtw">schilke</a>!)</span></li></ul>I also had a <a href="http://xkcd.com/">xkdc</a> (<span style="font-style: italic;">a webcomic of romance, sarcasm, math, and language</span>) specific bookmarklet, but I just learned about the <a href="https://addons.mozilla.org/en-US/firefox/addon/1715">Long Titles Firefox extension</a> that obsoletes it.<br /><br />I think that I'll make the hacks available as <span style="font-weight: bold;">DanceLikeMattHardingWare</span>:<br /><blockquote>You are free to do with this whatever you fancy, but you are expected to do some small <a href="http://video.google.com/videoplay?docid=4333821212636205852#2m53s">à la Matt Harding dancing steps</a> now and then.<br /><br />If you are too serious to dance, consider changing some things in your life, or just use it under some form of <a href="http://en.wikipedia.org/wiki/Beerware">beerware</a> or <a href="http://creativecommons.org/">Creative Commons</a> licensing.</blockquote><br /><a title="Matt Harding in Berlin" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.wherethehellismatt.com/"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_T679aggANRU/RrbS6EOtDsI/AAAAAAAAACk/lPAMwz74sK0/s320/matt_in_berlin.jpg" border="0" alt="Matt Harding in Berlin" id="BLOGGER_PHOTO_ID_5095491923425955522" /></a>-Xvhttp://www.blogger.com/profile/12954073038736466058noreply@blogger.com0tag:blogger.com,1999:blog-9115644605833384138.post-64232092752173199742007-05-27T17:32:00.000+01:002007-05-27T18:12:11.201+01:00Bookmarking things within gmailRestoring a Firefox session accidentally told me that, when you open messages/chats in a new window, you get an url that you can bookmark/copy to another file. Nice.<br /><br />Exploring things a bit further showed that gmail uses frames, so you can use the url of the inner frame to bookmark contacts, labels, filters, searches or any other thing that does not have the "New Window" link. In Firefox, use the popup menu, and "This Frame > Open frame in new tab".<br /><br />Very handy for those of us that run our lifes in tiddlywikis.<br /><br />Of course, Google is perfectly free to change these misterious urls not likely intended for public consumption...-Xvhttp://www.blogger.com/profile/12954073038736466058noreply@blogger.com0tag:blogger.com,1999:blog-9115644605833384138.post-21016931960263236652007-01-10T14:23:00.000+01:002007-10-06T09:38:43.777+01:00Bulk upload to googlepagesA <a href="http://xdexavier.googlepages.com/uploadHowTo.html">tool for batch uploads to googlepages</a>, as anticipated in an <a href="http://xdexavier.blogspot.com/2007/01/my-browser-my-rules-my-chrome.html">earlier post</a>.-Xvhttp://www.blogger.com/profile/12954073038736466058noreply@blogger.com1tag:blogger.com,1999:blog-9115644605833384138.post-16162012660920317632007-01-09T23:44:00.000+01:002007-01-10T10:35:10.857+01:00My browser, my rules, my chrome<span style="font-weight: bold;">Summary:</span> there are times when Firefox security gets in your way. Having a directory where you can place xul, html and scripts to run with chrome privileges enables you to shoot yourself in the foot and to create nice and handy hacks.<br /><br /><span style="font-weight: bold;">The itch that called for scratching:</span> I wanted to hack something to let me upload several files at once to <a href="http://googlepages.com/">googlepages</a> [1]. The problem is that, for very good reasons, you can not use JavaScript to change the value of input fields of type file: you usualy don't want scripts reading files in your disk. So, a bookmarklet, that to the browser looks as if it were part of the page, wouldn't cut it. Greasemonkey userscripts do <a href="http://diveintogreasemonkey.org/etech2006/#slide31">run sandboxed, but not under chrome privilege</a> [2], so I did not try that. I tried to give the page <a href="http://citebite.com/q6m6j4u5uvqh">UniversalFileRead privilege</a> [3][4], but failed.<br /><br /><span style="font-weight: bold;">A chrome folder.</span> From <a href="http://xulblog.de/xul/archives/7-Under-chromes-influence.html">Under chrome's influence</a>, slightly modified,<br /><blockquote><br />In the browser's installation directory, create a new file <code>chrome/mychrome.manifest</code> and put a single line into it:<br /><pre>content mychrome file:///D:/whatever/mychrome/<br /></pre>Note that the trailing slash is significant. Then create the file <code>D:\whatever\mychrome\hello.txt</code> and add some text:<br /><pre>hello world!<br /></pre>After a complete restart of your browser, you can open that file using <code>chrome://mychrome/content/hello.txt</code>.<br /></blockquote>You need to keep in mind that chrome is catched, so you may not see the changes you make immediately. Setting <a href="http://kb.mozillazine.org/Nglayout.debug.disable_xul_cache"><code>nglayout.debug.disable_xul_cache</code></a> to <code>true</code> [5] or the <a href="http://ted.mielczarek.org/code/mozilla/extensiondev/">Extension Developer's Extension</a> ability to reload chrome without restarting the browser are helpful here.<br /><br /><span style="font-weight: bold;">Future plans:</span><br /><ul><li>the bulk upload to googlepages is working nicely; needs some docu before uploading it.</li><li>I want to have a browser window with chrome privileges so that I can have more freedom of what I can do with some file: urls. Specifically<br /></li><ul><li>have known tiddlywikis granted <code>UniversalXPConnect</code> privilege <a href="http://groups-beta.google.com/group/TiddlyWikiDev/browse_frm/thread/5a8ddb015a6e738/97a25887d760a7d3?hl=en#97a25887d760a7d3">without having to grant it to everything from file:</a> and without having to mess with the <code>capability.principal.codebase</code> annoyance.</li><li>have local files use a script loaded from the web, or have a remote file load a script from my disk, so that I don't have to upload files while writing/debugging javascript.<br /></li></ul></ul><span style="font-weight: bold;">Footnotes:</span><br /><span style="font-size:85%;"><span style="font-weight: bold;">[1]</span> googlepages: yeah, I know, I'm cheap!<br /><span style="font-weight: bold;">[2]</span> Mark Pilgrim's slides on sandboxing greasemonkey have a wonderful <a href="http://diveintogreasemonkey.org/etech2006/#slide10">"how to become an expert" detour</a>. Don't miss it.<br />And, just in case you are a powerpoint author, consider <a href="http://meyerweb.com/eric/tools/s5/">S5</a> (a Simple Standards-Based Slide Show System), the tool used for Mark's slides.<br /><span style="font-weight: bold;">[3]</span> UniversalFileRead: I added to my <a href="http://kb.mozillazine.org/User.js_file">user.js</a><br /><pre>user_pref("capability.principal.codebase.googlepages1.granted", "UniversalFileRead");<br />user_pref("capability.principal.codebase.googlepages1.id", "http://pages.google.com/");<br /></pre>but still got a security exception.<br /><span style="font-weight: bold;">[4]</span> Highlighted link thanks to <a href="http://citebite.com/">http://citebite.com</a>.<br /><span style="font-weight: bold;">[5]</span> <code>nglayout.debug.disable_xul_cache</code>: I haven't tried it. As I write this,I realize that my <code>user.js</code> sets it to <code>true</code> while my <code>prefs.js</code> ignores it and keeps it to <code>false</code>. <del>I'm clueless here.</del> <span style="font-weight: bold;">Update:</span> A ";" was missing at the end of its user_pref line. Life is much better with this setting enabled!<br /></span>-Xvhttp://www.blogger.com/profile/12954073038736466058noreply@blogger.com2tag:blogger.com,1999:blog-9115644605833384138.post-80775166496894210362007-01-09T07:49:00.000+01:002007-01-09T07:51:25.744+01:00¿Cómo he llegado hasta aquí?<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.squarefree.com/extensions/high"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.squarefree.com/extensions/high/high-logo.png" alt="" border="0" /></a>Si te instalas esta extensión de Firefox podrás saber cómo llegaste por primera vez a una página: <a href="http://www.squarefree.com/extensions/high/">How'd I Get Here?</a>.<br /><br />Otra pequeña joya de <a href="http://www.squarefree.com/">Jesse Ruderman</a>, uno de los mayores expertos en seguridad del Firefox y familia.-Xvhttp://www.blogger.com/profile/12954073038736466058noreply@blogger.com0tag:blogger.com,1999:blog-9115644605833384138.post-54780136087634448212006-12-11T01:18:00.000+01:002006-12-11T01:22:06.667+01:00Tab Mix Plus + TiddlyWiki = [productivity | guilt]<ul><li>I'm a big fan of the <a href="http://tmp.garyr.net/">Tab Mix Plus</a> Firefox extension. I have a hard time when using a browser without it and I cannot duplicate tabs, undo tab closing, store several browsing sessions, list all the opened tabs in a dropdown menu...</li><li>I'm an even bigger fan of <a href="http://tiddlywiki.com/">TiddlyWikis</a>(*), personal wikis that are self-contained in a single html file that can be in your hard drive or usb stick, or hosted in the terrific and free <a href="http://tiddlyspot.com/">tiddlyspot</a> service. I use them to record personal knowledge, to write docs and "microtag" at the paragraph level, to write checklists, to keep my to-do lists...<br /></li></ul><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://simonbaird.com/images/monkeygtd/revLogo2.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://simonbaird.com/images/monkeygtd/revLogo2.gif" alt="" border="0" /></a><br />I just changed a Tab Mix Plus preference to switch to my left tab whenever I close a tab. And my left tab always hosts my to-do list in the shape of a <a href="http://monkeygtd.blogspot.com/">MonkeyGTD tiddlywiki</a>.<br /><br />Will this change mean that my browsing parties will end up being shorter and I'll be pushed to Get Thing Done instead of following yet another interesting link?<br /><br />Or am I just adding guilty feeling drops to some future pointless browsing?<br /><br />(*) aside: It was the former IBM Rational <a href="http://radio.weblogs.com/0100945/">Doug Landauer</a> that pointed me to TiddlyWikis (among the endless list of interesting links that he always posted in his intranet blog(**)). It was the magic of seeing a wiki run in my browser that changed my perception of JavaScript and got me interested in it.<br /><br />(**) See? I just checked <a href="http://del.icio.us/scruzia">Doug's delicious bookmarks</a> and see a link to <a href="http://tarekziade.wordpress.com/2006/11/06/how-to-prevent-drowning-in-the-huge-rss-daily-feed-you-receive/">the Atomisator</a>, some Python scripts that I'd like to check closer to help me avoid drowning in the rss tide... (***)<br /><br />(***) The pattern of me getting lost following links should be quite obvious at this point :-)-Xvhttp://www.blogger.com/profile/12954073038736466058noreply@blogger.com2