[Project_owners] view a file inside a zip/jar/xpi

James Wright jamesw at bsdhosting.co.za
Sun Feb 22 02:18:16 EST 2004


heh, taking off anything after the ! leads us to the
jar documentation @ sun.



<quote who="Biju G C">
> This is new to me,
>
> Using mozilla/firefox we can view a file inside a zip/jar/xpi
>
> zip/jar/xpi may be at http://, file://, resource://  location
> (i have not tried ftp:// but I belive that too)
>
> Try
> jar:http://mirror.meisterwerk.net/rmozdev/links/WebLinks.xpi!/install.js
>
>
> More on Firefox:
> jar:resource:///chrome/browser.jar!/content/browser/about.png
> jar:resource:///chrome/browser.jar!/content/browser/browser.js
>
> More on Mozilla
> jar:resource:///chrome/modern.jar!/skin/modern/communicator/button.css
>
>
> we can even do
> jar:jar:http://mirror.meisterwerk.net/rmozdev/links/WebLinks.xpi!/WebLinks.jar!/content/weblinks/macroeditor.js
>
> yeah, read from a zip file inside another zip file.
>
>
> XMLHttpRequest can also handle this
>
> try
>
> function readfileinjar(url,path)
> {
>  var p = new XMLHttpRequest();
>  var path2 = path;
>  if(path2.substr(0,1) != "/") path2="/" + path2;
>  p.open("GET", "jar:" + url + "!" + path2, false);
>  p.send(null);
>  return p.responseText;
> };
>
>
> alert(readfileinjar("http://mirror.meisterwerk.net/rmozdev/links/WebLinks.xpi",
> "/install.js") )
>
>
>
>
>
> ___________________________________________________________
> Yahoo! Messenger - Communicate instantly..."Ping"
> your friends today! Download Messenger Now
> http://uk.messenger.yahoo.com/download/index.html
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
>



More information about the Project_owners mailing list