crxviewer icon indicating copy to clipboard operation
crxviewer copied to clipboard

[Feature Request] Default file extension option

Open yfdyh000 opened this issue 5 years ago • 4 comments

I prefer to keep the original extension of the file. Expected option: zip or leave blank by default, leave blank = original extension. Allow users to set to like crx, xpi, etc. (unlimited)

yfdyh000 avatar Aug 25 '18 15:08 yfdyh000

Also I have a question, click the "View source" button of popup adds the &zipname=, use the "View extension source" context menu don't adds the the parameter, but both downloads get the same zip extension.

yfdyh000 avatar Aug 25 '18 15:08 yfdyh000

In addition, there is a glitch, no index: tab.index + 1 in contextMenusOnClicked.

yfdyh000 avatar Aug 25 '18 15:08 yfdyh000

xpi files are zips, CRX files are not really zips (but I convert them to a zip file by stripping the CRX-specific header). I use a "zip" extension because it is the most accurate file extension for the download, with the best usability when one is interested in viewing the source of the extension (opposed to installing it).

Why do you want to have the ability to accept different extensions? What is the use case?

The filename (zipname or constructed from the URL) is always converted to a zip extension:: https://github.com/Rob--W/crxviewer/blob/96b9e8e08381842c10ba82e5c79a77f8abe6671a/src/crxviewer.js#L1841 https://github.com/Rob--W/crxviewer/blob/96b9e8e08381842c10ba82e5c79a77f8abe6671a/src/cws_pattern.js#L158-L172

In addition, there is a glitch, no index: tab.index + 1 in contextMenusOnClicke.

That's easy to fix. Do you want to submit a pull request? Bonus: In Firefox, you can set the browser.tabs.insertAfterCurrent preference to true to automatically open the tab after the current tab. This preference is also available through an extension API ( https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserSettings/newTabPosition ) and used by e.g. the Always Right add-on ( https://addons.mozilla.org/en-US/firefox/addon/always-right/ ).

Rob--W avatar Aug 25 '18 20:08 Rob--W

In addition, there is a glitch, no index: tab.index + 1 in contextMenusOnClicked.

This part is fixed in https://github.com/Rob--W/crxviewer/commit/1a007bd8f77a6d43e88c761ad61cf0fa587bd6b6

If you still want the originally requested feature, please answer the question about the use case from my previous comment.

Rob--W avatar Oct 21 '18 22:10 Rob--W