Skip to content

Commit

Permalink
Apply suggestions from code review to remaining files
Browse files Browse the repository at this point in the history
Co-authored-by: rebloor <[email protected]>
  • Loading branch information
Rob--W and rebloor committed May 17, 2023
1 parent 98c6e36 commit 017d5c0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dnr-block-only/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Block only, without host_permissions",
"description": "Blocks requests to 'blocksub', 'blocktop' or 'blockall'. Due to the 'declarativeNetRequest' permission, host_permissions in manifest.json are not needed.",
"description": "Blocks requests to 'blocksub', 'blocktop', and 'blockall'. Uses the 'declarativeNetRequest' permission, meaning that host_permissions in manifest.json are not needed.",
"version": "0.1",
"permissions": [
"declarativeNetRequest"
Expand Down
2 changes: 1 addition & 1 deletion dnr-block-only/testpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h2 id="blocksub">Block requests containing 'blocksub' (except main_frame)</h2>
<div>
rule 1 will not block top-level navigations to
<a href="https://developer.mozilla.org/favicon.ico?blocksub">https://developer.mozilla.org/favicon.ico?blocksub</a>
because top-level navigation ("main_frame") requests are not matched by default,
because top-level navigation ("main_frame") requests are not matched
when "resourceTypes" and "excludedResourceTypes" are not specified.
</div>

Expand Down
2 changes: 1 addition & 1 deletion dnr-dynamic-with-options/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "DNR dynamic with options",
"description": "Modify requests according to user-specifies rules in the options page.",
"description": "Modify requests according to the rules specified by the user in the options page.",
"version": "0.1",
"permissions": ["declarativeNetRequestWithHostAccess"],
"optional_host_permissions": ["*://*/"],
Expand Down
5 changes: 2 additions & 3 deletions dnr-redirect-url/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<body>
<h2>Host permission requirement</h2>
To redirect requests, the extension needs host permissions.<br>
"Manage Extensions" (<code>about:addons</code>) offers a built-in UI to grant or revoke permissions.<br>
The <code>permissions</code> extension API offers the ability to build your own UI:
While "Manage Extensions" (<code>about:addons</code>) offers a built-in UI to grant or revoke permissions, this extension uses the <code>permissions</code> API to build the request into the UI:
<p>
<label>
<input type="checkbox" id="checkbox_host_permission">
Expand All @@ -19,7 +18,7 @@ <h2>Host permission requirement</h2>
<h2>Test cases</h2>
There are four rules in <a href="redirect-rules.json">redirect-rules.json</a>; each rule has a test case here.
<ul>
<li>1: <a href="https://example.com/">example.com/</a> should redirect to <a href="redirectTarget.html">redirectTarget.html</a> packaged within the extension.</li>
<li>1: <a href="https://example.com/">example.com/</a> should redirect to <a href="redirectTarget.html">redirectTarget.html</a> packaged in the extension.</li>
<li>2: <a href="https://example.com/ew">example.com/ew</a> should redirect to <code>extensionworkshop.com</code></li>
<li>3: <a href="https://www.example.com/anything">https://www.example.com/anything</a> should redirect to <code>https://example.com/anything?redirected_from_www=1</code>.</li>
<li>4: <a href="http://example.com/no_question">http://example.com/no_question</a> should redirect to <code>https://example.com/no_question?redirected_by_regex</code>.</li>
Expand Down
2 changes: 1 addition & 1 deletion dnr-redirect-url/redirectTarget.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
</pre>

For the redirect to have succeeded, three conditions need to be met:
For the redirect to have succeeded, three conditions must be met:

<ul>
<li> The declarativeNetRequest (DNR) rule should match the request.</li>
Expand Down
4 changes: 2 additions & 2 deletions examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"name": "discogs-search"
},
{
"description": "Demonstrates how to block network requests without host permissions through the declarativeNetRequest API with the `declarative_net_request` manifest key.",
"description": "Demonstrates how to block network requests without host permissions using the declarativeNetRequest API with the `declarative_net_request` manifest key.",
"javascript_apis": [
"declarativeNetRequest.Rule",
"declarativeNetRequest.RuleAction",
Expand All @@ -180,7 +180,7 @@
"name": "dnr-dynamic-with-options"
},
{
"description": "Demonstrates multiple ways to redirect requests using the declarativeNetRequest API through the `declarative_net_request` manifest key. Demonstrates aspects of Manifest Version 3 (MV3): action, host_permissions, web_accessible_resources, and includes a comparison with Manifest Version 2 (MV2).",
"description": "Demonstrates multiple ways to redirect requests using the declarativeNetRequest API through the `declarative_net_request` manifest key. Demonstrates aspects of Manifest Version 3 (MV3): action, host_permissions, and web_accessible_resources, and includes a comparison with Manifest Version 2 (MV2).",
"javascript_apis": [
"declarativeNetRequest.Redirect",
"declarativeNetRequest.Rule",
Expand Down

0 comments on commit 017d5c0

Please sign in to comment.