Closed Bug 587191 Opened 14 years ago Closed 13 years ago

Page worker doesn't accept a URL object as content

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: peregrino, Unassigned)

Details

If you create one page worker this way:

  pageWorker.Page({ content: require("tabs").activeTab.location});

It throws an error, about content not being an URL. The problem is that it IS a URL, just not a URL _string_.

So, as warner said on IRC: "The content option must be a string with HTML, or a URL object as returned by the 'url' module." 
If that is not the desired way, then at least the thrown error or the documentation should state that you need to pass a _string_ URL or HTML code.
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product.

To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
Version: Trunk → unspecified
Fixed by this commit:
https://github.com/mozilla/addon-sdk/commit/8dfbadc4624f2e7490050aaa380c13958b372ce0#packages/jetpack-core/lib/page-worker.js
Where we renamed content to contentURL and only accept URL string.
And the document now explicitely says that contentURL is a string:
https://jetpack.mozillalabs.com/sdk/1.0b3/docs/packages/addon-kit/docs/page-worker.html
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.