Skip to content

Commit fd5c38d

Browse files
committed
Make search part of StrippedLocation
1 parent 9a206e6 commit fd5c38d

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

src/entrypoints/content.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function detectLocation(): StrippedLocation {
1515
const result = {
1616
host: window.location.host,
1717
pathname: window.location.pathname,
18+
search: window.location.search,
1819
}
1920
logger.debug("[gitcasso] detectLocation called, returning:", result)
2021
return result

src/lib/enhancer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export interface CommentEvent {
2626
export interface StrippedLocation {
2727
host: string
2828
pathname: string
29+
search: string
2930
}
3031

3132
/** Wraps the textareas of a given platform with Gitcasso's enhancements. */

tests/corpus-fixture.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export function detectedSpots() {
6666
const location: StrippedLocation = {
6767
host: window.location.host,
6868
pathname: window.location.pathname,
69+
search: window.location.search,
6970
}
7071
const detectionResults = []
7172
for (const textarea of textareas) {
@@ -86,6 +87,7 @@ export function tableUI() {
8687
const location: StrippedLocation = {
8788
host: window.location.host,
8889
pathname: window.location.pathname,
90+
search: window.location.search,
8991
}
9092
const uiResults = []
9193
for (const textarea of textareas) {

tests/corpus-view.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ function getUrlParts(key: string) {
9797
hostname: url.hostname,
9898
href: originalUrl,
9999
pathname: url.pathname,
100+
search: url.search,
100101
}
101102
}
102103

@@ -566,7 +567,8 @@ function createGitcassoScript(
566567
// Set up mocked location
567568
window.gitcassoMockLocation = {
568569
host: '${urlParts.host}',
569-
pathname: '${urlParts.pathname}'
570+
pathname: '${urlParts.pathname}',
571+
search: '${urlParts.search}'
570572
};
571573
572574
// Set up browser API mocks
@@ -603,7 +605,8 @@ function createGitcassoScript(
603605
);
604606
window.gitcassoMockLocation = {
605607
host: '${urlParts.host}',
606-
pathname: '${urlParts.pathname}'
608+
pathname: '${urlParts.pathname}',
609+
search: '${urlParts.search}'
607610
};
608611
609612
// Execute the patched script with browser API mocks prepended

0 commit comments

Comments
 (0)