Closed Bug 714994 Opened 13 years ago Closed 13 years ago

restore url.toFilename

Categories

(Add-on SDK Graveyard :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: warner, Assigned: warner)

Details

Attachments

(1 file)

We recently removed require("url").toFilename() in the process of adding support for unpacked XPIs (bug 638742). We were a bit hasty, though, because toFilename was a documented public API (still documented in packages/api-utils/docs/url.md), so we shouldn't have removed it without warning (and probably a deprecation period). The OpenWebApps folks were using it to copy files out of the data/ directory when building "native apps" (xulrunner launchers).

In the short term, we should restore this API, possibly with the caveat that it will throw an exception when asked to create a filename inside a packed XPI. In the long term, we should offer a different mechanism to enumerate the contents of a data/ directory, so we can deprecate and remove toFilename (since we really do want XPIs to remain packed, even ones that need to copy things out of data/).
Attached file pull request 318
Alex: see if you think this testing approach seems right. I've run the tests both with the default unpack=false, and while it was set to unpack=true.
Attachment #585619 - Flags: review?(poirot.alex)
Comment on attachment 585619 [details]
pull request 318

Looks good. Tests pass with unpack true and false.
Attachment #585619 - Flags: review?(poirot.alex) → review+
Commits pushed to https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/9cc99f60ae0284a3f9f4a61c18afc1ae02fff9d0
Bug 714994: Restore (limited) url.toFilename and .fromFilename.

They only work for addon-provided resource: URLs when the XPI is unpacked.
Update the tests to exercise this (but only for whatever value of unpack= the
SDK uses: to exercise both sides, you must manually edit
python-lib/cuddlefish/rdf.py and
python-lib/cuddlefish/app-extension/install.rdf, then re-run 'cfx testall').

This reverts 45859d658a1283e2a5e94940ab100285a6d94056.

https://github.com/mozilla/addon-sdk/commit/7ea2ce42e78d99fcc12afcc496bfb0bdcfe32561
Bug 714994: Restore (limited) url.toFilename and .fromFilename. r=@ochameau
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: