Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init to http://zap/ #79

Merged
merged 4 commits into from
Oct 23, 2023
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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- Storage events not being reported.
4 changes: 2 additions & 2 deletions source/Background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ function cookieChangeHandler(
): void {
Browser.storage.sync
.get({
zapurl: 'http://localhost:8080/',
zapurl: 'http://zap/',
zapkey: 'not set',
})
.then((items) => {
Expand All @@ -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',
});
});
Expand Down
2 changes: 1 addition & 1 deletion source/Options/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions test/ContentScript/integrationTests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand All @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions test/ContentScript/webpages/integrationTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
</head>
<body>
<a href="#test">Link</a>
<script>
localStorage.setItem('localzapurl', "http://localhost:8080/");
localStorage.setItem('localzapenable', "true");
</script>
</body>
</html>