Closed Bug 612716 Opened 15 years ago Closed 15 years ago

rename contentScriptURL to contentScriptFile

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: myk, Assigned: irakli)

References

()

Details

(Whiteboard: [has review][needs new patch])

Attachments

(1 file)

The contentScriptURL property is intended to only accept references to local files. That is intentional, because loading content scripts from remote URLs allows developers to bypass the AMO review process for privileged code. However, the name of the property suggests that it accepts arbitrary URLs, which is misleading. The property should instead be called contentScriptFile to make it clear that it only accepts references to local files.
Assignee: nobody → rFobic
Attachment #492945 - Attachment description: v1 → https://github.com/mozilla/addon-sdk/pull/48
Comment on attachment 492945 [details] [diff] [review] https://github.com/mozilla/addon-sdk/pull/48 r=me with the doc changes below. makes me wonder though if we need it to be a URL at all. why not just the path fragment off the data dir? would be able to remove all the extraneous require("self").data.url() bits. >diff --git a/packages/addon-kit/docs/page-mod.md b/packages/addon-kit/docs/page-mod.md >index 3ba10bf..3e868dd 100644 >--- a/packages/addon-kit/docs/page-mod.md >+++ b/packages/addon-kit/docs/page-mod.md >@@ -169,13 +169,13 @@ Creates a PageMod. > a description of match pattern syntax. > At least one match pattern must be supplied. > [match-pattern]: #module/jetpack-core/match-pattern >- @prop [contentScriptURL] {string,array} >+ @prop [contentScriptFile] {string,array} > The URLs of content scripts to load. Content scripts specified by this > option are loaded *before* those specified by the `contentScript` option. > Optional. s/URLs/local file URLs/ >diff --git a/packages/addon-kit/docs/page-worker.md b/packages/addon-kit/docs/page-worker.md >index 738d09d..f6673bc 100644 >--- a/packages/addon-kit/docs/page-worker.md >+++ b/packages/addon-kit/docs/page-worker.md >@@ -81,12 +81,12 @@ its `destroy` method is called or the add-on is unloaded. > An object with keys to configure the permissions of the Page Worker. > The boolean key `script` controls if scripts from the page > are allowed to run. Its default value is false. >- @prop [contentScriptURL] {string,array} >+ @prop [contentScriptFile] {string,array} > The URLs of content scripts to load. Content scripts specified by this > option are loaded *before* those specified by the `contentScript` option. s/URLs/local file URLs/ >@@ -108,7 +108,7 @@ The URL of the content loaded. > are allowed to run. > </api> > >-<api name="contentScriptURL"> >+<api name="contentScriptFile"> > @property {array} > The URLs of content scripts to load. Content scripts specified by this property > are loaded *before* those specified by the `contentScript` property. s/URLs/local file URLs/ >diff --git a/packages/addon-kit/docs/panel.md b/packages/addon-kit/docs/panel.md >index e32c84e..7017aae 100644 >--- a/packages/addon-kit/docs/panel.md >+++ b/packages/addon-kit/docs/panel.md >@@ -83,13 +83,13 @@ Creates a panel. > Whether or not to execute script in the content. Defaults to true. > Optional. > Optional. >- @prop [contentScriptURL] {string,array} >+ @prop [contentScriptFile] {string,array} > The URLs of content scripts to load. Content scripts specified by this > option are loaded *before* those specified by the `contentScript` option. > Optional. s/URLs/local file URLs/ >@@ -126,7 +126,7 @@ Permissions for the content, with the following keys: > Whether or not to execute script in the content. Defaults to true. > </api> > >-<api name="contentScriptURL"> >+<api name="contentScriptFile"> > @property {array} > The URLs of content scripts to load. Content scripts specified by this > property are loaded *before* those specified by the `contentScript` property. s/URLs/local file URLs/ >diff --git a/packages/addon-kit/docs/widget.md b/packages/addon-kit/docs/widget.md >index 0872c2c..4a1e958 100644 >--- a/packages/addon-kit/docs/widget.md >+++ b/packages/addon-kit/docs/widget.md >@@ -134,13 +134,15 @@ Represents a widget object. > @prop [script] {boolean} > Whether or not to execute script in the content. Defaults to true. > >- @prop [contentScriptURL] {array} >- The URLs of content scripts to load. Content scripts specified by this property >- are loaded *before* those specified by the `contentScript` property. >+ @prop [contentScriptFile] {array} >+ The URLs of content scripts to load. Content scripts specified by this >+ property are loaded *before* those specified by the `contentScript` >+ property. s/URLs/local file URLs/ >diff --git a/packages/jetpack-core/docs/content/loader.md b/packages/jetpack-core/docs/content/loader.md >index fc41495..f126e5f 100644 >--- a/packages/jetpack-core/docs/content/loader.md >+++ b/packages/jetpack-core/docs/content/loader.md >@@ -43,7 +43,7 @@ in frame every time `contentURL` property is changed: > > <api name="Loader"> > @class >-<api name="contentScriptURL"> >+<api name="contentScriptFile"> > @property {array} > The URLs of content scripts to load. Content scripts specified by this property > are loaded *before* those specified by the `contentScript` property. s/URLs/local file URLs/ >diff --git a/packages/jetpack-core/docs/content/symbiont.md b/packages/jetpack-core/docs/content/symbiont.md >index 42f5935..8f52631 100644 >--- a/packages/jetpack-core/docs/content/symbiont.md >+++ b/packages/jetpack-core/docs/content/symbiont.md >@@ -72,7 +72,7 @@ Creates a content symbiont. > Optional. > </api> > >-<api name="contentScriptURL"> >+<api name="contentScriptFile"> > @property {array} > The URLs of content scripts to load. Content scripts specified by this property > are loaded *before* those specified by the `contentScript` property. s/URLs/local file URLs/ >diff --git a/packages/jetpack-core/docs/content/worker.md b/packages/jetpack-core/docs/content/worker.md >index 86b4065..1214851 100644 >--- a/packages/jetpack-core/docs/content/worker.md >+++ b/packages/jetpack-core/docs/content/worker.md >@@ -53,13 +53,13 @@ Creates a content worker. > Options for the constructor, with the following keys: > @prop window {object} > The content window to create JavaScript sandbox for communication with. >- @prop [contentScriptURL] {string,array} >+ @prop [contentScriptFile] {string,array} > The URLs of content scripts to load. Content scripts specified by this > option are loaded *before* those specified by the `contentScript` option. > Optional. s/URLs/local file URLs/ >diff --git a/static-files/md/dev-guide/web-content.md b/static-files/md/dev-guide/web-content.md >index ee81a43..ffc7040 100644 >--- a/static-files/md/dev-guide/web-content.md >+++ b/static-files/md/dev-guide/web-content.md >@@ -71,14 +71,14 @@ The constructors for content-script-using objects such as panel and page-mod > define a group of options for loading content scripts: > > contentScript string, array >- contentScriptURL string, array >+ contentScriptFile string, array > contentScriptWhen string > > We have already seen the `contentScript` option, which enables you to pass > in the text of the script itself as a string literal. This version of the API > avoids the need to maintain a separate file for the content script. > >-The `contentScriptURL` option enables you to pass in the URL from which the >+The `contentScriptFile` option enables you to pass in the URL from which the s/URL/local file URL/
Attachment #492945 - Flags: review?(dietrich) → review+
Whiteboard: [has review][needs new patch]
82e1fdb
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: