Skip to content

Commit 0e7dfdc

Browse files
committed
remove the chrome build
1 parent 7321b28 commit 0e7dfdc

File tree

7 files changed

+1
-64
lines changed

7 files changed

+1
-64
lines changed

CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ injected/src/features/broker-protection/ @duckduckgo/content-scope-scripts-owner
1414
Sources/ @duckduckgo/content-scope-scripts-owners @duckduckgo/apple-devs
1515
injected/entry-points/android.js @duckduckgo/content-scope-scripts-owners @duckduckgo/android-devs
1616
injected/entry-points/extension-mv3.js @duckduckgo/content-scope-scripts-owners @kzar @sammacbeth
17-
injected/entry-points/chrome.js @duckduckgo/content-scope-scripts-owners @kzar @sammacbeth
1817
injected/entry-points/windows.js @duckduckgo/content-scope-scripts-owners @duckduckgo/team-windows-development
1918

2019
# Test owners

injected/entry-points/chrome.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44
import { isTrackerOrigin } from '../src/trackers';
55
import { computeLimitedSiteObject } from '../src/utils';
6-
import contentScopeFeatures from 'ddg:contentScopeFeatures';
76

87
/**
98
* Inject all the overwrites into the page.

injected/scripts/entry-points.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { parseArgs, write } from '../../scripts/script-utils.js';
55
* @typedef Build
66
* @property {string} input
77
* @property {string[]} output
8-
* @property {boolean} [postProcess] - optional value to post-process an output file
98
*
109
* @typedef {Record<NonNullable<ImportMeta['injectName']>, Build>} BuildManifest
1110
*/
@@ -18,7 +17,6 @@ const builds = {
1817
},
1918
apple: {
2019
input: 'entry-points/apple.js',
21-
postProcess: true,
2220
output: ['../Sources/ContentScopeScripts/dist/contentScope.js'],
2321
},
2422
'apple-isolated': {
@@ -53,10 +51,6 @@ const builds = {
5351
input: 'entry-points/extension-mv3.js',
5452
output: ['../build/chrome-mv3/inject.js'],
5553
},
56-
chrome: {
57-
input: 'entry-points/chrome.js',
58-
output: ['../build/chrome/inject.js'],
59-
},
6054
};
6155

6256
async function init() {

injected/scripts/utils/build.js

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import * as esbuild from 'esbuild';
66
const ROOT = join(cwd(import.meta.url), '..', '..');
77
const DEBUG = false;
88

9-
const contentScopePath = 'src/content-scope-features.js';
10-
const contentScopeName = 'contentScopeFeatures';
11-
129
const prefixMessage = '/*! © DuckDuckGo ContentScopeScripts protections https://github.com/duckduckgo/content-scope-scripts/ */';
1310

1411
/**
@@ -52,7 +49,7 @@ export async function bundle(params) {
5249
'import.meta.injectName': JSON.stringify(platform),
5350
'import.meta.trackerLookup': trackerLookup,
5451
},
55-
plugins: [loadFeaturesPlugin, contentFeaturesAsString(platform)],
52+
plugins: [loadFeaturesPlugin],
5653
footer: {
5754
js: suffixMessage,
5855
},
@@ -122,45 +119,6 @@ function loadFeatures(platform, featureNames = platformSupport[platform]) {
122119
};
123120
}
124121

125-
/**
126-
* Create a bundle and allow it to be imported as a string via
127-
* `import bundle from 'ddg:contentScopeFeatures'`
128-
*
129-
* @param {string} platform
130-
*/
131-
function contentFeaturesAsString(platform) {
132-
const pluginId = 'ddg:contentScopeFeatures';
133-
return {
134-
/**
135-
* Load all platform features based on current
136-
*/
137-
name: pluginId,
138-
setup(build) {
139-
build.onResolve({ filter: new RegExp(pluginId) }, (args) => {
140-
return {
141-
path: args.path,
142-
namespace: pluginId,
143-
};
144-
});
145-
build.onLoad({ filter: /.*/, namespace: pluginId }, async () => {
146-
const result = await bundle({
147-
scriptPath: contentScopePath,
148-
name: contentScopeName,
149-
platform,
150-
});
151-
152-
const encodedString = result.replace(/\r\n/g, '\n');
153-
154-
return {
155-
loader: 'text',
156-
resolveDir: ROOT,
157-
contents: encodedString,
158-
};
159-
});
160-
},
161-
};
162-
}
163-
164122
/**
165123
* Convert `featureName` to `feature-name`
166124
*

injected/src/globals.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,3 @@ declare module 'ddg:platformFeatures' {
4747
const output: Record<string, new (featureName: string) => import('./content-feature').default>;
4848
export default output;
4949
}
50-
declare module 'ddg:contentScopeFeatures' {
51-
const output: string;
52-
export default output;
53-
}

injected/unit-test/verify-artifacts.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const BUILD = join(ROOT, 'build');
99
const APPLE_BUILD = join(ROOT, 'Sources/ContentScopeScripts/dist');
1010
console.log(APPLE_BUILD);
1111
let CSS_OUTPUT_SIZE = 760_000;
12-
const CSS_OUTPUT_SIZE_CHROME = CSS_OUTPUT_SIZE * 1.45; // 45% larger for Chrome MV2 due to base64 encoding
1312
if (process.platform === 'win32') {
1413
CSS_OUTPUT_SIZE = CSS_OUTPUT_SIZE * 1.1; // 10% larger for Windows due to line endings
1514
}
@@ -22,13 +21,6 @@ const checks = {
2221
{ kind: 'containsString', text: 'define_import_meta_trackerLookup_default', includes: true },
2322
],
2423
},
25-
chrome: {
26-
file: join(BUILD, 'chrome/inject.js'),
27-
tests: [
28-
{ kind: 'maxFileSize', value: CSS_OUTPUT_SIZE_CHROME },
29-
{ kind: 'containsString', text: '$TRACKER_LOOKUP$', includes: true },
30-
],
31-
},
3224
'chrome-mv3': {
3325
file: join(BUILD, 'chrome-mv3/inject.js'),
3426
tests: [

typedoc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const config = {
1111
entryPoints: [
1212
'injected/entry-points/android.js',
1313
'injected/entry-points/apple.js',
14-
'injected/entry-points/chrome.js',
1514
'injected/entry-points/extension-mv3.js',
1615
'injected/entry-points/windows.js',
1716
'injected/src/types/*.ts',

0 commit comments

Comments
 (0)