diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cbd274..7e2bef1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## Unreleased +### Changed + +- Init ZAP URL to http://zap/ instead of http://localhost:8080/ ## 0.0.6 - 2023-09-19 ### Fixed -- Storage events not being reported. \ No newline at end of file +- Storage events not being reported. diff --git a/source/Background/index.ts b/source/Background/index.ts index ce2c80c..7199642 100644 --- a/source/Background/index.ts +++ b/source/Background/index.ts @@ -303,7 +303,7 @@ function cookieChangeHandler( ): void { Browser.storage.sync .get({ - zapurl: 'http://localhost:8080/', + zapurl: 'http://zap/', zapkey: 'not set', }) .then((items) => { @@ -321,7 +321,7 @@ Browser.runtime.onMessage.addListener(onMessageHandler); Browser.runtime.onInstalled.addListener((): void => { console.emoji('🦄', 'extension installed'); Browser.storage.sync.set({ - zapurl: 'http://localhost:8080/', + zapurl: 'http://zap/', zapkey: 'not set', }); }); diff --git a/source/Options/index.tsx b/source/Options/index.tsx index 5c98d84..eb76ba3 100644 --- a/source/Options/index.tsx +++ b/source/Options/index.tsx @@ -46,7 +46,7 @@ function restoreOptions(): void { Browser.storage.sync .get({ - zapurl: 'http://localhost:8080/', + zapurl: 'http://zap/', zapkey: 'not set', zapenable: true, zaprecordingactive: false, diff --git a/test/ContentScript/integrationTests.test.ts b/test/ContentScript/integrationTests.test.ts index c697f02..f3e1d64 100644 --- a/test/ContentScript/integrationTests.test.ts +++ b/test/ContentScript/integrationTests.test.ts @@ -65,8 +65,7 @@ function integrationTests( await page.close(); // Then const expectedData = - '["{\\"action\\":{\\"action\\":\\"reportEvent\\"},\\"body\\":{\\"eventJson\\":\\"{TIMESTAMP,\\"eventName\\":\\"pageLoad\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"count\\":1}\\",\\"apikey\\":\\"not set\\"}}",' + - '"{\\"action\\":{\\"action\\":\\"reportObject\\"},\\"body\\":{\\"objectJson\\":\\"{TIMESTAMP,\\"type\\":\\"nodeAdded\\",\\"tagName\\":\\"A\\",\\"id\\":\\"\\",\\"nodeName\\":\\"A\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"href\\":\\"http://localhost:1801/webpages/integrationTest.html#test\\",\\"text\\":\\"Link\\"}\\",\\"apikey\\":\\"not set\\"}}"]'; + '["{\\"action\\":{\\"action\\":\\"reportEvent\\"},\\"body\\":{\\"eventJson\\":\\"{TIMESTAMP,\\"eventName\\":\\"pageLoad\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"count\\":1}\\",\\"apikey\\":\\"not set\\"}}","{\\"action\\":{\\"action\\":\\"reportObject\\"},\\"body\\":{\\"objectJson\\":\\"{TIMESTAMP,\\"type\\":\\"nodeAdded\\",\\"tagName\\":\\"A\\",\\"id\\":\\"\\",\\"nodeName\\":\\"A\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"href\\":\\"http://localhost:1801/webpages/integrationTest.html#test\\",\\"text\\":\\"Link\\"}\\",\\"apikey\\":\\"not set\\"}}","{\\"action\\":{\\"action\\":\\"reportObject\\"},\\"body\\":{\\"objectJson\\":\\"{TIMESTAMP,\\"type\\":\\"localStorage\\",\\"tagName\\":\\"\\",\\"id\\":\\"localzapenable\\",\\"nodeName\\":\\"\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"text\\":\\"true\\"}\\",\\"apikey\\":\\"not set\\"}}","{\\"action\\":{\\"action\\":\\"reportObject\\"},\\"body\\":{\\"objectJson\\":\\"{TIMESTAMP,\\"type\\":\\"localStorage\\",\\"tagName\\":\\"\\",\\"id\\":\\"localzapurl\\",\\"nodeName\\":\\"\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"text\\":\\"http://localhost:8080/\\"}\\",\\"apikey\\":\\"not set\\"}}"]'; expect(JSON.stringify(Array.from(actualData))).toBe(expectedData); }); @@ -77,7 +76,7 @@ function integrationTests( await driver.setEnable(false); const page = await context.newPage(); await page.goto( - `http://localhost:${_HTTPPORT}/webpages/integrationTest.html` + `http://localhost:${_HTTPPORT}/webpages/interactions.html` ); await page.waitForLoadState('networkidle'); await page.waitForTimeout(1000); diff --git a/test/ContentScript/webpages/integrationTest.html b/test/ContentScript/webpages/integrationTest.html index 9072c37..7ce07c7 100644 --- a/test/ContentScript/webpages/integrationTest.html +++ b/test/ContentScript/webpages/integrationTest.html @@ -5,5 +5,9 @@
Link +