Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ words:
- DFFFE
- DFFFF
- dtrace
- duckduckgo
- EFFFE
- EFFFF
- esbuild
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import 'uno.css';
import './style.css';

export default defineContentScript({
matches: ['https://*.duckduckgo.com/*'],
matches: ['https://example.com/*'],
cssInjectionMode: 'manifest',

async main(ctx) {
const dynamicUI = createIntegratedUi(ctx, {
position: 'inline',
append: 'after',
anchor: 'form[role=search]',
anchor: 'p',
onMount: (container) => {
const app = document.createElement('div');
container.id = 'automount-anchor';
Expand Down Expand Up @@ -54,7 +54,7 @@ export default defineContentScript({
const stopAutoMountButton = createIntegratedUi(ctx, {
position: 'inline',
append: 'last',
anchor: 'form[role=search]',
anchor: 'p',
onMount: (container) => {
const app = document.createElement('button');
container.classList.add('flex', 'flex-justify-center');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
:root {
color-scheme: dark;
color-scheme: light;
}
4 changes: 2 additions & 2 deletions packages/wxt-demo/src/entrypoints/ui.content/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import './style.css';
import manualStyle from './manual-style.css?inline';

export default defineContentScript({
matches: ['https://*.duckduckgo.com/*'],
matches: ['https://example.com/*'],
cssInjectionMode: 'ui',

async main(ctx) {
Expand All @@ -15,7 +15,7 @@ export default defineContentScript({
name: 'demo-ui',
position: 'inline',
append: 'before',
anchor: 'form[role=search]',
anchor: 'p',
onMount: (container) => {
const app = document.createElement('div');
app.classList.add('m-4', 'text-red-500');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
body {
padding: 2rem;
background-color: blanchedalmond;
background-color: white;
}
2 changes: 1 addition & 1 deletion packages/wxt-demo/wxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineConfig({
open: true,
},
webExt: {
startUrls: ['https://duckduckgo.com'],
startUrls: ['https://example.com'],
},
example: {
a: 'a',
Expand Down
4 changes: 2 additions & 2 deletions packages/wxt/e2e/tests/output-structure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ describe('Output Directory Structure', () => {
project.addFile(
'entrypoints/named.content.jsx',
`export default defineContentScript({
matches: ["*://*.duckduckgo.com/*"],
matches: ["*://*.example.com/*"],
main() {},
})`,
);
Expand All @@ -244,7 +244,7 @@ describe('Output Directory Structure', () => {
.toMatchInlineSnapshot(`
".output/chrome-mv3/manifest.json
----------------------------------------
{"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"]}]}"
{"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"]}]}"
`);
expect(await project.pathExists('.output/chrome-mv3/background.js'));
expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ describe('Content Script Utils', () => {
it('should be consistent regardless of the object ordering and default values', () => {
const hash1 = hashContentScriptOptions({
allFrames: true,
matches: ['*://google.com/*', '*://duckduckgo.com/*'],
matches: ['*://google.com/*', '*://example.com/*'],
matchAboutBlank: false,
});
const hash2 = hashContentScriptOptions({
matches: ['*://duckduckgo.com/*', '*://google.com/*'],
matches: ['*://example.com/*', '*://google.com/*'],
allFrames: true,
});

Expand Down
4 changes: 2 additions & 2 deletions packages/wxt/src/internal/__tests__/manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ describe('Manifest Utils', () => {
inputPath: 'entrypoints/four.content/index.ts',
outputDir: contentScriptOutDir,
options: {
matches: ['*://duckduckgo.com/*'],
matches: ['*://example.com/*'],
runAt: 'document_end',
},
skipped: false,
Expand Down Expand Up @@ -1058,7 +1058,7 @@ describe('Manifest Utils', () => {
js: ['content-scripts/two.js', 'content-scripts/three.js'],
});
expect(actual.content_scripts).toContainEqual({
matches: ['*://duckduckgo.com/*'],
matches: ['*://example.com/*'],
run_at: 'document_end',
css: ['content-scripts/four.css'],
js: ['content-scripts/four.js'],
Expand Down
Loading