Skip to content

Commit 51f4afa

Browse files
Add building tips (#1807)
* Add building tips * Lint fix * Update CODEOWNERS --------- Co-authored-by: David Harbage <[email protected]>
1 parent fe735b6 commit 51f4afa

File tree

4 files changed

+54
-2
lines changed

4 files changed

+54
-2
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
* @duckduckgo/content-scope-scripts-owners
22

33
# Documentation - anyone can edit
4-
injected/docs/ *
4+
injected/docs/
55

66
# Feature owners
77
injected/src/features/fingerprinting-* @duckduckgo/content-scope-scripts-owners @jonathanKingston @englehardt

injected/docs/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This directory contains detailed documentation for the Content Scope Scripts pro
99
- **[API Reference](./api-reference.md)** - Complete reference for the Content Scope Features API
1010
- **[Features Guide](./features-guide.md)** - How to develop features and understand the feature lifecycle
1111
- **[Platform Integration](./platform-integration.md)** - Platform-specific implementation details and integration patterns
12+
- **[Platform-Specific Build & Troubleshooting Tips](./build-and-troubleshooting.md)** - Troubleshooting and setup tips for iOS, macOS, Android, Windows, and Extensions
1213

1314
### Development Resources
1415

@@ -25,7 +26,7 @@ This directory contains detailed documentation for the Content Scope Scripts pro
2526
If you're new to Content Scope Scripts, start with the main [README](../README.md) for a high-level overview, then dive into the specific documentation based on your needs:
2627

2728
- **Building features?**[Features Guide](./features-guide.md)
28-
- **Integrating with a platform?**[Platform Integration](./platform-integration.md)
29+
- **Integrating with a platform?**[Platform Integration](./platform-integration.md) and [Platform-Specific Build & Troubleshooting Tips](./build-and-troubleshooting.md)
2930
- **Using the API?**[API Reference](./api-reference.md)
3031
- **Developing utilities?**[Development Utilities](./development-utilities.md)
3132
- **Testing your changes?**[Testing Guide](./testing-guide.md)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Platform-Specific Build & Troubleshooting Tips
2+
3+
This document provides platform-specific build instructions, troubleshooting steps, and local development tips for integrating and working with Content Scope Scripts (C-S-S) across iOS, macOS, Android, Windows, and browser extensions.
4+
5+
---
6+
7+
## iOS/macOS
8+
9+
- **Check Xcode Version:**
10+
- [.xcode-version](https://github.com/duckduckgo/apple-browsers/tree/main/.xcode-version)
11+
- **Set up C-S-S or Autofill as a Local Dependency:**
12+
- Drag the folder from Finder into the directory panel in Xcode.
13+
- **Privacy Config Files:**
14+
- Both apps bundle a privacy config file: [macos-config.json](https://github.com/duckduckgo/apple-browsers/blob/main/macOS/DuckDuckGo/ContentBlocker/macos-config.json) & [ios-config.json](https://github.com/duckduckgo/apple-browsers/blob/main/iOS/Core/ios-config.json).
15+
- To test privacy config changes, update this file as well as the config endpoint for remote updates ([macOS](https://github.com/duckduckgo/apple-browsers/blob/main/macOS/DuckDuckGo/Application/AppConfigurationURLProvider.swift#L60) & [iOS](https://github.com/duckduckgo/apple-browsers/blob/main/iOS/Core/AppURLs.swift#L49)).
16+
- **If you receive errors related to packages:**
17+
- File > Packages > Reset Package Caches
18+
- Clean Project with `cmd+K`
19+
- Delete all files inside `~/Library/Developer/Xcode/DerivedData`
20+
- If none of that works, ask for help in the [Apple Devs Mattermost channel](https://chat.duckduckgo.com/ddg/channels/devs).
21+
22+
## Android
23+
24+
- [Override the Privacy Remote Config](https://app.asana.com/1/137249556945/project/1202561462274611/task/1203855276415003?focus=true)
25+
- Ensure the config version is higher than the current version (the app may refuse to update otherwise).
26+
- **Clean Project:**
27+
- Build → 'Clean Project' (clears cache of potentially stale C-S-S file).
28+
- Uninstall the app from the emulator as well.
29+
- **Linking Local Dependencies:**
30+
- Use `npm link @duckduckgo/content-scope-scripts` or `npm link @duckduckgo/autofill` to link to your local checkout.
31+
- In that directory, also run `npm link` in the dependency folder.
32+
- This symlinks to your local dir and acts as if you're pointing to your PR.
33+
- Run `npm build` in C-S-S (not run automatically like in the extension).
34+
- **Alternative Android Setup (more reliable):**
35+
- Alter the path of the resources in the appropriate module's `build.gradle` to an absolute path on your machine.
36+
- Example: [build.gradle gist](https://gist.github.com/shakyShane/0b133a0782bdb37c876c4a4204667bb2)
37+
- After making this change, click 'sync now' when Gradle prompts.
38+
- All changes in C-S-S will be picked up every time you restart the app.
39+
- This works for all JS dependencies (Autofill, Dashboard, C-S-S, etc).
40+
41+
## Windows
42+
43+
- [Work with content-scope-scripts repo on Windows](./development-utilities.md#windows-development)
44+
- [Debugging `autofill.js` (or other submodules) on Windows](https://app.asana.com/1/137249556945/project/1198964220583541/task/1208938714611510)
45+
46+
## Extensions
47+
48+
- Use npm link as per Android.
49+
- See the [other development steps](https://github.com/duckduckgo/duckduckgo-privacy-extension/blob/main/CONTRIBUTING.md#building-the-extension).

injected/docs/platform-integration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,5 @@ Check that relevant Privacy Features are working as expected:
119119
- **Cookie protection**:
120120
- [Block Third Party Tracking Cookies Implementation Guidelines](https://app.asana.com/1/137249556945/project/1198207348643509/task/1200539099112751?focus=true)
121121
- [Expire First Party Script Cookies Implementation Guidelines](https://app.asana.com/1/137249556945/project/1198207348643509/task/1200364574828671?focus=true)
122+
123+
See [Platform-Specific Build & Troubleshooting Tips](./build-and-troubleshooting.md) for detailed troubleshooting and setup instructions.

0 commit comments

Comments
 (0)