Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Issue 8352042: Update contentSettings extension API docs. (Closed)

Created:
9 years, 2 months ago by Bernhard Bauer
Modified:
9 years ago
Reviewers:
Kathy Walrath
Visibility:
Public.

Description

Update contentSettings extension API docs. BUG=71067 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107097

Patch Set 1 #

Total comments: 36

Patch Set 2 : review #

Total comments: 26

Patch Set 3 : review #

Patch Set 4 : show methods and events in TOC #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 2

Patch Set 7 : '' #

Total comments: 2

Patch Set 8 : fix link #

Unified diffs Side-by-side diffs Delta from patch set Stats (+919 lines, -25 lines) Patch
M chrome/common/extensions/api/extension_api.json View 1 2 3 4 5 8 chunks +9 lines, -9 lines 0 comments Download
M chrome/common/extensions/docs/contentSettings.html View 1 2 3 4 5 6 7 12 chunks +195 lines, -14 lines 0 comments Download
A chrome/common/extensions/docs/experimental.contentSettings.html View 4 5 6 1 chunk +540 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/manifest.html View 4 5 6 1 chunk +5 lines, -1 line 0 comments Download
M chrome/common/extensions/docs/samples.json View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/extensions/docs/static/contentSettings.html View 1 2 3 4 5 6 7 1 chunk +153 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/static/experimental.contentSettings.html View 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/static/manifest.html View 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 17 (0 generated)
Bernhard Bauer
Please review.
9 years, 2 months ago (2011-10-20 11:58:15 UTC) #1
Use mkwst_at_chromium.org plz.
On 2011/10/20 11:58:15, Bernhard Bauer wrote: > Please review. You'll need an OWNER for the ...
9 years, 2 months ago (2011-10-20 12:07:40 UTC) #2
Bernhard Bauer
On 2011/10/20 12:07:40, mkwst wrote: > On 2011/10/20 11:58:15, Bernhard Bauer wrote: > > Please ...
9 years, 2 months ago (2011-10-20 12:09:17 UTC) #3
Use mkwst_at_chromium.org plz.
At a glance; Kathy should do a deeper pass. http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/docs/static/contentSettings.html File chrome/common/extensions/docs/static/contentSettings.html (right): http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/docs/static/contentSettings.html#newcode5 chrome/common/extensions/docs/static/contentSettings.html:5: ...
9 years, 2 months ago (2011-10-20 12:17:31 UTC) #4
battre
http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/api/extension_api.json File chrome/common/extensions/api/extension_api.json (right): http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/api/extension_api.json#newcode8179 chrome/common/extensions/api/extension_api.json:8179: "description": "The resource identifier for the given content type." ...
9 years, 2 months ago (2011-10-20 22:32:12 UTC) #5
Bernhard Bauer
Updated. Staged version at http://www/~bauerb/extension_docs/contentSettings.html. http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/api/extension_api.json File chrome/common/extensions/api/extension_api.json (right): http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/api/extension_api.json#newcode8179 chrome/common/extensions/api/extension_api.json:8179: "description": "The resource identifier ...
9 years, 2 months ago (2011-10-21 14:04:18 UTC) #6
kathyw
http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc... File chrome/common/extensions/docs/static/contentSettings.html (right): http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc... chrome/common/extensions/docs/static/contentSettings.html:2: I see no methods in the staged version of ...
9 years, 2 months ago (2011-10-21 16:54:59 UTC) #7
Bernhard Bauer
On 2011/10/21 16:54:59, kathyw wrote: > http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc... > File chrome/common/extensions/docs/static/contentSettings.html (right): > > http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc... > ...
9 years, 2 months ago (2011-10-24 09:03:58 UTC) #8
Bernhard Bauer
On 2011/10/24 09:03:58, Bernhard Bauer wrote: > On 2011/10/21 16:54:59, kathyw wrote: > > > ...
9 years, 2 months ago (2011-10-24 11:14:15 UTC) #9
kathyw
>> > I see no methods in the staged version of this page. Do they ...
9 years, 2 months ago (2011-10-24 15:55:09 UTC) #10
Aaron Boodman
http://codereview.chromium.org/8352042/diff/17001/chrome/common/extensions/docs/static/contentSettings.html File chrome/common/extensions/docs/static/contentSettings.html (right): http://codereview.chromium.org/8352042/diff/17001/chrome/common/extensions/docs/static/contentSettings.html#newcode38 chrome/common/extensions/docs/static/contentSettings.html:38: that port. If no port number is specified, the ...
9 years, 2 months ago (2011-10-24 15:59:24 UTC) #11
Bernhard Bauer
http://codereview.chromium.org/8352042/diff/17001/chrome/common/extensions/docs/static/contentSettings.html File chrome/common/extensions/docs/static/contentSettings.html (right): http://codereview.chromium.org/8352042/diff/17001/chrome/common/extensions/docs/static/contentSettings.html#newcode38 chrome/common/extensions/docs/static/contentSettings.html:38: that port. If no port number is specified, the ...
9 years, 2 months ago (2011-10-24 16:18:26 UTC) #12
kathyw
LGTM, after you fix one bad link. http://codereview.chromium.org/8352042/diff/16005/chrome/common/extensions/do... File chrome/common/extensions/docs/contentSettings.html (right): http://codereview.chromium.org/8352042/diff/16005/chrome/common/extensions/do... chrome/common/extensions/docs/contentSettings.html:494: <a href="method-ContentSetting-getResourceIdentifiers"> ...
9 years, 2 months ago (2011-10-24 16:22:18 UTC) #13
Aaron Boodman
On 2011/10/24 16:18:26, Bernhard Bauer wrote: > http://codereview.chromium.org/8352042/diff/17001/chrome/common/extensions/docs/static/contentSettings.html > File chrome/common/extensions/docs/static/contentSettings.html (right): > > http://codereview.chromium.org/8352042/diff/17001/chrome/common/extensions/docs/static/contentSettings.html#newcode38 ...
9 years, 2 months ago (2011-10-24 18:01:12 UTC) #14
battre
lgtm
9 years, 2 months ago (2011-10-25 10:01:49 UTC) #15
Bernhard Bauer
http://codereview.chromium.org/8352042/diff/16005/chrome/common/extensions/docs/contentSettings.html File chrome/common/extensions/docs/contentSettings.html (right): http://codereview.chromium.org/8352042/diff/16005/chrome/common/extensions/docs/contentSettings.html#newcode494 chrome/common/extensions/docs/contentSettings.html:494: <a href="method-ContentSetting-getResourceIdentifiers"> Fixed. The anchor is already there, it's ...
9 years, 2 months ago (2011-10-25 10:37:55 UTC) #16
kathyw
9 years ago (2011-12-13 02:47:31 UTC) #17
Ignore... Just trying to get this stupid issue out of my queue...

http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/docs/s...
File chrome/common/extensions/docs/static/contentSettings.html (right):

http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/docs/s...
chrome/common/extensions/docs/static/contentSettings.html:10: <h2
id="patterns">Content Setting Patterns</h2>

Content Setting Patterns -> Content setting patterns

(we use Title Case only in page names; headings use Sentence case)

http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/docs/s...
chrome/common/extensions/docs/static/contentSettings.html:12: You can set
patterns that match multiple origins, like <code>youtube.com</code>
I agree with your comment, Mike. I'd tweak it a bit. Maybe:

You use <em>match patterns</em>
to specify the websites in each content setting's scope.
For example, the match pattern 'http://*.youtube.com/'
specifies youtube.com and all of its subdomains.
For details, see
_Match Patterns_.

http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/docs/s...
chrome/common/extensions/docs/static/contentSettings.html:22: <h3
id="pattern-precedence">Pattern Precedence</h3>

Pattern Precedence -> Pattern precedence

http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/docs/s...
chrome/common/extensions/docs/static/contentSettings.html:30: <h2
id="resourceIdentifiers">Resource Identifiers</h2>

Resource Identifiers -> Resource identifiers

http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/docs/s...
chrome/common/extensions/docs/static/contentSettings.html:33: sub-types of a
content type. Currently, the only content type that supports

sub-types -> subtypes

http://codereview.chromium.org/8352042/diff/1/chrome/common/extensions/docs/s...
chrome/common/extensions/docs/static/contentSettings.html:41: <p>You must
declare the "contentSettings" permission
Usually the manifest section goes higher up and has a certain format (with
example code). See bookmarks.html for a typical example.

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
File chrome/common/extensions/docs/static/contentSettings.html (right):

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:2: 

I see no methods in the staged version of this page. Do they have "nodoc" or
something? For example, there's no getResourceIdentifier() method.

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:6: websites can use
features such as cookies, Javascript, and plug-ins.

Javascript -> JavaScript

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:26: <h2
id="patterns">Content Setting Patterns</h2>

We use Sentence caps for sections (Title Caps for page names), so:

Content Setting Patterns -> Content setting patterns

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:31: <a
href="match_patterns.html">Match Pattern documentation</a>.</p>
I like Mike's suggestion, but I'd tweak it a bit to avoid passive voice and make
the example a little clearer. Maybe:

You can use patterns to specify the websites that each content setting affects.
For example, 'http://*.youtube.com/'
specifies youtube.com and all of its subdomains.
The syntax for content setting patterns is the same as for
<a href="match_patterns.html">match patterns</a>,
with a few differences:

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:33: Note that there
are some differences between patterns for content settings and

No need for a separate paragraph, I think. The previous paragraph made me think
that content setting patterns *were* match patterns. I rewrote to make clearer
that there are some differences.

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:36:
<code>https</code>, and <code>ftp</code> URLs the path has to be a wildcard
URLs the -> URLs, the
has to be -> must be

(use "must" whenever something's absolute -- it's clearer that way)

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:37: (<code>/*</code>).
For <code>file</code> URLs, the path has to be completely

has to be -> must be

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:38: specified and is
<strong>not</strong> allowed to contain wildcards.</li>

is not allowed to -> <strong>must not</strong.

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:46: <h3
id="pattern-precedence">Pattern Precedence</h3>

Pattern Precedence -> Pattern precedence

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:51: <p>For example,
the following patterns are ordered by precedence:

Add </p> at the end

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:52: <ul>

Use a <ol> instead of <ul> here, since the order matters.

(bullets imply that order is unimportant)

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:58: There are three
ways in which one pattern can be more specific than another
Add <p> tag; rewrite to be more precise and avoid "There are". Maybe:

<p>
Three kinds of wildcards affect how specific a pattern is:
</p>

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:61: <li>Wildcards in
the port (like <code>http://www.example.com:*/*</code>)</li>

like -> for example,

(in this and the following 2 items)

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:68: hostname, scheme,
port. That means that for example the list of URLs above is

That means that for example -> For example,

"the list of URLs above..." is imprecise -- I didn't know whether you means the
first list in the section or the second. Change the rest of the paragraph to be
more precise. Maybe:

For example, the following URLs are ordered by precedence:
<ol>
  <li> http://www.example.com:*/*
     <br>
     Specifies the hostname and scheme </li>
  <li> *:/www.example.com:123/*
    <br>
    Not as high, because although it specifies the hostname, it doesn't specify
the scheme </li>
  <li> http://*.example.com:123/*
    <br>
    Lower because although it specifies the port and scheme, it has a wildcard
in the hostname </li>

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:74: <h2
id="primary-secondary">Primary and Secondary Patterns</h2>

Primary and Secondary Patterns -> Primary and secondary patterns

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:81: Some content types
also can take additional URLs into account. For example,

delete "also" (redundant")

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:88: If there are
multiple rules with primary and secondary patterns, the rule with
Rewrite to avoid "there are" and be clearer. Maybe:

If there are multiple rules with
->
If multiple rules have

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:89: the more specific
primary pattern takes precedence. If there are multiple rules

If there are multiple rules with
 ->
If multiple rules have

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:92: pairs is ordered
by precedence:

Add </p> at the end of this paragraph.

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:93: <table>
Add a table header. Perhaps also add a column for the order, to match the <ol>s
above and make the precedence crystal clear:

<tr><th>Precedence</th><th>Primary pattern</th><th>Secondary pattern</th>
<tr><td>1</td><td>...

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:110: <h2
id="resource-identifiers">Resource Identifiers</h2>

Resource Identifiers -> Resource identifiers

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:113: sub-types of a
content type. Currently, the only content type that supports

GLOBAL: sub-type -> subtype

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:121: For example, if
there is a content setting rule with the resource identifier

there is a content setting rule with the
->
a content setting rule has the

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:128: <a
href=""><code>getResourceIdentifiers</code></a> method. The returned list can
Add "()" after method names. E.g.:

<code>getResourceIdentifiers()</code>

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:128: <a
href=""><code>getResourceIdentifiers</code></a> method. The returned list can
What should this link to?

http://codereview.chromium.org/8352042/diff/5002/chrome/common/extensions/doc...
chrome/common/extensions/docs/static/contentSettings.html:134: 
It'd be nice to have a brief example of using the content settings API here, in
a <pre> section.

and actually... I can't find any examples in the Samples page. I mean, there are
3 samples that use contentSettings, but no .js files are listed there.

http://codereview.chromium.org/8352042/diff/16005/chrome/common/extensions/do...
File chrome/common/extensions/docs/contentSettings.html (right):

http://codereview.chromium.org/8352042/diff/16005/chrome/common/extensions/do...
chrome/common/extensions/docs/contentSettings.html:494: <a
href="method-ContentSetting-getResourceIdentifiers">
This is a bad link. Perhaps remove the link for this CL, and add the right one
for the next?

Powered by Google App Engine
This is Rietveld 408576698