SandySynaptik Posted May 20, 2011 Share Posted May 20, 2011 Information about this mission :Software installed: Firefox 4, XAMPPYou might think that this is totally a Firefox problem and I should go to Firefox help forums but.......I have a firefox addon named example.xpi(as an example) I tried opening that by firefox but it says that "*extension name* could not be installed because it is not compatible with Firefox 4", which was compatible before I formatted my PC Now next I tried to store that example.xpi file on the localhost server (using XAMPP), but when I click on the link then firefox tries to save that file instead of installing it.At this point I came to know that addons.mozilla.org uses ?src=addondetail at the last of the URI for example "https://addons.mozilla.org/firefox/downloads/latest/__example__/example.xpi?src=addondetail"How do I create this ?src=addondetail?? I think it's not so simple because when I simple added this [e.g. http://localhost/example.xpi?src=addondetail] then there was the same result as it was second time.. Link to comment Share on other sites More sharing options...
birbal Posted May 20, 2011 Share Posted May 20, 2011 but when I click on the link then firefox tries to save that file instead of installing it.probably you need to set some sort of header to recognise it as it has to be isntalled rather than download. check for the docs of mozilla what is the mime type of the addomns should fix this issue. Link to comment Share on other sites More sharing options...
SandySynaptik Posted May 20, 2011 Author Share Posted May 20, 2011 Hey I found the MIME type of the mozilla addons, its application/x-xpinstall but how to make it install in firefox?? Where to put this application/x-xpinstall? Link to comment Share on other sites More sharing options...
thescientist Posted May 20, 2011 Share Posted May 20, 2011 like birbal said, in the headers. I would look up how to implement headers with PHP.http://php.net/manual/en/function.header.php Link to comment Share on other sites More sharing options...
SandySynaptik Posted May 20, 2011 Author Share Posted May 20, 2011 Hey guys, I have tried that link, nothing worked. when I'm refreshing the page after that (applying what said on that page), there is still same thing happening. Please help... Link to comment Share on other sites More sharing options...
thescientist Posted May 20, 2011 Share Posted May 20, 2011 you should post your modified code so we can see what you tried. Link to comment Share on other sites More sharing options...
SandySynaptik Posted May 20, 2011 Author Share Posted May 20, 2011 Here is the code I tried : <?phpheader('Content-type: application/x-xpinstall');header('Content-Disposition: attachment; filename="example.xpi"');readfile('example.xpi');?> Link to comment Share on other sites More sharing options...
thescientist Posted May 20, 2011 Share Posted May 20, 2011 and that's the first (output) thing on the page? Link to comment Share on other sites More sharing options...
birbal Posted May 20, 2011 Share Posted May 20, 2011 header('Content-Disposition: attachment; filename="example.xpi"');Removeing it should fix it. it is forcing to download prompt Link to comment Share on other sites More sharing options...
SandySynaptik Posted May 20, 2011 Author Share Posted May 20, 2011 Removeing it should fix it. it is forcing to download promptAnd this worked, thanks to all of here to help, its working now... :) Link to comment Share on other sites More sharing options...
SandySynaptik Posted May 20, 2011 Author Share Posted May 20, 2011 and that's the first (output) thing on the page?It was giving a dialog box whether to save that file or run it... Link to comment Share on other sites More sharing options...
SandySynaptik Posted May 20, 2011 Author Share Posted May 20, 2011 The bad news is that addon is still not working :)But I learnt a new thing today, thanks all... Link to comment Share on other sites More sharing options...
thescientist Posted May 20, 2011 Share Posted May 20, 2011 I meant in the code. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.