Skip to content

Commit d875335

Browse files
author
Shane Osbourne
committed
Added documentation support
1 parent 29e02b2 commit d875335

14 files changed

+229
-11
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/
2+
docs/
23
lib/
34
Sources/ContentScopeScripts/dist/
45
integration-test/extension/contentScope.js

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ node_modules/
33
.swiftpm
44
.env
55
build/
6-
Sources/ContentScopeScripts/dist/
6+
docs/
7+
Sources/ContentScopeScripts/dist/

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Each platform calls into the API exposed by content-scope-features.js where the
88

99
The exposed API is a global called contentScopeFeatures and has three methods:
1010
- load
11-
- Calls the load method on all of the features
11+
- Calls the load method on all the features
1212
- init
13-
- Calls the init method on all of the features
13+
- Calls the init method on all the features
1414
- This should be passed the arguments object which has the following keys:
1515
- 'platform' which is an object with:
1616
- 'name' which is a string of 'android', 'ios', 'macos' or 'extension'
17-
- 'debug' true if debuging should be enabled
17+
- 'debug' true if debugging should be enabled
1818
- 'globalPrivacyControlValue' false if the user has disabled GPC.
1919
- 'sessionKey' a unique session based key.
2020
- 'cookie' TODO
@@ -24,7 +24,7 @@ The exposed API is a global called contentScopeFeatures and has three methods:
2424
- 'domain' the hostname of the site in the URL bar
2525
- 'enabledFeatures' this is an array of features/ to enable
2626
- update
27-
- Calls the update method on all of the features
27+
- Calls the update method on all the features
2828

2929
## Features
3030

@@ -51,7 +51,7 @@ The [inject/](https://github.com/duckduckgo/content-scope-scripts/tree/main/inje
5151
- In Firefox the code is loaded as a standard extension content script.
5252
- For Apple, Windows and Android the code is a UserScript that has some string replacements for properties and loads in as the page scope.
5353
- Note: currently we don't implement the update calls as it's only required by cookie protections which we don't implement.
54-
- All other browsers the code is stringified, base64 encoded and injected in as a self deleting <script> tag.
54+
- All other browsers the code is stringified, base64 encoded and injected in as a self deleting `<script>` tag.
5555

5656
In the built output you will see these dramatic differences in the bundled code which is created into: /build
5757

@@ -60,10 +60,10 @@ In the built output you will see these dramatic differences in the bundled code
6060
- `$CONTENT_SCOPE$` - raw remote config object
6161
- `$USER_UNPROTECTED_DOMAINS$` - an array of user allowlisted domains
6262
- `$USER_PREFERENCES$` - an object containing:
63-
- platform: { name: '<ios | macos | extension | android>' }
63+
- platform: `{ name: '<ios | macos | extension | android>' }`
6464
- debug: boolean
6565
- globalPrivacyControlValue: boolean
66-
- sessionKey: <CSRNG UUID 4 string> (used for fingerprinting) - this should regnerate on browser close or every 24 hours.
66+
- sessionKey: `<CSRNG UUID 4 string>` (used for fingerprinting) - this should regenerate on browser close or every 24 hours.
6767

6868
### Features scope injection utilities
6969

inject/android.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/**
2+
* @module Android integration
3+
*/
14
/* global contentScopeFeatures */
2-
35
import { processConfig, isGloballyDisabled } from './../src/utils'
46

57
function init () {

inject/apple.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @module Apple integration
3+
*/
14
/* global contentScopeFeatures */
25

36
import { processConfig, isGloballyDisabled } from './../src/utils'

inject/chrome-mv3.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @module Chrome MV3 integration
3+
*/
14
/* global contentScopeFeatures */
25

36
import { isTrackerOrigin } from '../src/trackers'

inject/chrome.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @module Chrome integration
3+
*/
14
import { isTrackerOrigin } from '../src/trackers'
25

36
/**

inject/integration.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
/* global contentScopeFeatures */
1+
/**
2+
* @module Testing integration
3+
*/
24

5+
/* global contentScopeFeatures */
36
function getTopLevelURL () {
47
try {
58
// FROM: https://stackoverflow.com/a/7739035/73479

inject/mozilla.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @module Mozilla integration
3+
*/
14
/* global contentScopeFeatures */
25
import { isTrackerOrigin } from '../src/trackers'
36

inject/windows.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/**
2+
* @module Windows integration
3+
*/
14
/* global contentScopeFeatures */
2-
35
import { processConfig, isGloballyDisabled, windowsSpecificFeatures } from './../src/utils'
46

57
function init () {

0 commit comments

Comments
 (0)