Skip to content

Commit 38e9c93

Browse files
chore: Change start point of wxt-demo (#2591)
Co-authored-by: Patryk Kuniczak <p.kuniczak@gmail.com>
1 parent 37dd5dc commit 38e9c93

9 files changed

Lines changed: 14 additions & 15 deletions

File tree

‎cspell.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ words:
5353
- DFFFE
5454
- DFFFF
5555
- dtrace
56-
- duckduckgo
5756
- EFFFE
5857
- EFFFF
5958
- esbuild

‎packages/wxt-demo/src/entrypoints/automount.content/index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import 'uno.css';
22
import './style.css';
33

44
export default defineContentScript({
5-
matches: ['https://*.duckduckgo.com/*'],
5+
matches: ['https://example.com/*'],
66
cssInjectionMode: 'manifest',
77

88
async main(ctx) {
99
const dynamicUI = createIntegratedUi(ctx, {
1010
position: 'inline',
1111
append: 'after',
12-
anchor: 'form[role=search]',
12+
anchor: 'p',
1313
onMount: (container) => {
1414
const app = document.createElement('div');
1515
container.id = 'automount-anchor';
@@ -54,7 +54,7 @@ export default defineContentScript({
5454
const stopAutoMountButton = createIntegratedUi(ctx, {
5555
position: 'inline',
5656
append: 'last',
57-
anchor: 'form[role=search]',
57+
anchor: 'p',
5858
onMount: (container) => {
5959
const app = document.createElement('button');
6060
container.classList.add('flex', 'flex-justify-center');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
:root {
2-
color-scheme: dark;
2+
color-scheme: light;
33
}

‎packages/wxt-demo/src/entrypoints/ui.content/index.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import './style.css';
33
import manualStyle from './manual-style.css?inline';
44

55
export default defineContentScript({
6-
matches: ['https://*.duckduckgo.com/*'],
6+
matches: ['https://example.com/*'],
77
cssInjectionMode: 'ui',
88

99
async main(ctx) {
@@ -15,7 +15,7 @@ export default defineContentScript({
1515
name: 'demo-ui',
1616
position: 'inline',
1717
append: 'before',
18-
anchor: 'form[role=search]',
18+
anchor: 'p',
1919
onMount: (container) => {
2020
const app = document.createElement('div');
2121
app.classList.add('m-4', 'text-red-500');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
body {
22
padding: 2rem;
3-
background-color: blanchedalmond;
3+
background-color: white;
44
}

‎packages/wxt-demo/wxt.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default defineConfig({
2121
open: true,
2222
},
2323
webExt: {
24-
startUrls: ['https://duckduckgo.com'],
24+
startUrls: ['https://example.com'],
2525
},
2626
example: {
2727
a: 'a',

‎packages/wxt/e2e/tests/output-structure.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ describe('Output Directory Structure', () => {
233233
project.addFile(
234234
'entrypoints/named.content.jsx',
235235
`export default defineContentScript({
236-
matches: ["*://*.duckduckgo.com/*"],
236+
matches: ["*://*.example.com/*"],
237237
main() {},
238238
})`,
239239
);
@@ -244,7 +244,7 @@ describe('Output Directory Structure', () => {
244244
.toMatchInlineSnapshot(`
245245
".output/chrome-mv3/manifest.json
246246
----------------------------------------
247-
{"manifest_version":3,"name":"E2E Extension","description":"Example description","version":"0.0.0","background":{"service_worker":"background.js"},"content_scripts":[{"matches":["*://*.google.com/*"],"js":["content-scripts/content.js"]},{"matches":["*://*.duckduckgo.com/*"],"js":["content-scripts/named.js"]}]}"
247+
{"manifest_version":3,"name":"E2E Extension","description":"Example description","version":"0.0.0","background":{"service_worker":"background.js"},"content_scripts":[{"matches":["*://*.google.com/*"],"js":["content-scripts/content.js"]},{"matches":["*://*.example.com/*"],"js":["content-scripts/named.js"]}]}"
248248
`);
249249
expect(await project.pathExists('.output/chrome-mv3/background.js'));
250250
expect(

‎packages/wxt/src/internal-utils/__tests__/content-script-utils.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ describe('Content Script Utils', () => {
1919
it('should be consistent regardless of the object ordering and default values', () => {
2020
const hash1 = hashContentScriptOptions({
2121
allFrames: true,
22-
matches: ['*://google.com/*', '*://duckduckgo.com/*'],
22+
matches: ['*://google.com/*', '*://example.com/*'],
2323
matchAboutBlank: false,
2424
});
2525
const hash2 = hashContentScriptOptions({
26-
matches: ['*://duckduckgo.com/*', '*://google.com/*'],
26+
matches: ['*://example.com/*', '*://google.com/*'],
2727
allFrames: true,
2828
});
2929

‎packages/wxt/src/internal/__tests__/manifest.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ describe('Manifest Utils', () => {
997997
inputPath: 'entrypoints/four.content/index.ts',
998998
outputDir: contentScriptOutDir,
999999
options: {
1000-
matches: ['*://duckduckgo.com/*'],
1000+
matches: ['*://example.com/*'],
10011001
runAt: 'document_end',
10021002
},
10031003
skipped: false,
@@ -1058,7 +1058,7 @@ describe('Manifest Utils', () => {
10581058
js: ['content-scripts/two.js', 'content-scripts/three.js'],
10591059
});
10601060
expect(actual.content_scripts).toContainEqual({
1061-
matches: ['*://duckduckgo.com/*'],
1061+
matches: ['*://example.com/*'],
10621062
run_at: 'document_end',
10631063
css: ['content-scripts/four.css'],
10641064
js: ['content-scripts/four.js'],

0 commit comments

Comments
 (0)