{"id":159,"date":"2007-08-16T17:57:50","date_gmt":"2007-08-17T01:57:50","guid":{"rendered":"http:\/\/wp.colliertech.org\/cj\/?p=159"},"modified":"2007-08-17T04:50:40","modified_gmt":"2007-08-17T12:50:40","slug":"mediawiki-mozilla-and-remote-pages-linking-to-local-files","status":"publish","type":"post","link":"https:\/\/wp.c9h.org\/cj\/?p=159","title":{"rendered":"Mediawiki, Mozilla, and remote pages linking to local files"},"content":{"rendered":"<p>So I&#8217;ve got <a href=\"http:\/\/www.mediawiki.org\/\">mediawiki<\/a> running on an intranet web server, and I use it to store notes about the things I&#8217;m working on.  I downloaded a bunch of docs and started making links to the local copies of the manuals using the standard mediawiki notation, [url alias].<\/p>\n<p>However, in its default configuration, for security reasons, mediawiki does not produce links from URIs starting with file:\/\/.<\/p>\n<p>I was able to remedy this by adding the following to my wiki&#8217;s <a href=\"http:\/\/meta.wikimedia.org\/wiki\/LocalSettings.php\">LocalSettings.php<\/a>:<\/p>\n<pre>array_push($wgUrlProtocols, 'file:\/\/');<\/pre>\n<p>The next problem was that my browser itself did not like it that a remote web server was trying to direct me to files on my local machine.  It complained with the following in my javascript error console:<\/p>\n<pre>Security Error: Content at &lt;remote url&gt; may not load or link to file:\/\/&lt;local file path&gt;<\/pre>\n<p>This was resolved by a bit of research.  At the <a href=\"http:\/\/kb.mozillazine.org\/Links_to_local_pages_don't_work\">MozillaZine knowledge base<\/a>, they recommended adding the following to my <a href=\"http:\/\/kb.mozillazine.org\/User.js_file\">user.js<\/a>:<\/p>\n<pre>\r\nuser_pref(\"capability.policy.policynames\", \"localfilelinks\");\r\nuser_pref(\"capability.policy.localfilelinks.sites\", \"http:\/\/www.example.com\");\r\nuser_pref(\"capability.policy.localfilelinks.checkloaduri.enabled\", \"allAccess\");\r\n<\/pre>\n<p>I had a hard time figuring out where, exactly, my user.js file was, so I grabbed a copy of the <a href=\"http:\/\/webdesigns.ms11.net\/chromeditp.html\">ChromeEdit<\/a> Add-on.  After re-starting the browser, there was a <b>ChromeEdit Plus<\/b> menu item under <b><span style=\"text-decoration: underline\">T<\/span>ools<\/b>.  Selecting <b>ChromeEdit<\/b> from the submenu brought up a window with a <b>users.js<\/b> tab.  After pasting the above code into the form, modifying for my needs, pressing <b>Save<\/b>, and then <b>Restart<\/b>, my browser came back up and allowed me to follow links to local files from the host I indicated in <b>capability.policy.localfilelinks.sites<\/b>.<\/p>\n\n<div class=\"twitter-share\"><a href=\"https:\/\/twitter.com\/intent\/tweet?via=cjamescollier\" class=\"twitter-share-button\">Tweet<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>So I&#8217;ve got mediawiki running on an intranet web server, and I use it to store notes about the things I&#8217;m working on. I downloaded a bunch of docs and started making links to the local copies of the manuals using the standard mediawiki notation, [url alias]. However, in its default configuration, for security reasons, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[60,9,79,155,101,166,83],"tags":[],"class_list":["post-159","post","type-post","status-publish","format-standard","hentry","category-colliertech","category-firefox","category-free-software","category-mediawiki","category-security","category-software","category-wiki"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1YDIB-2z","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/posts\/159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=159"}],"version-history":[{"count":0,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/posts\/159\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}