File tree Expand file tree Collapse file tree 8 files changed +12
-12
lines changed Expand file tree Collapse file tree 8 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const enhancedTextareas = new TextareaRegistry()
1111
1212function detectLocation ( ) : StrippedLocation {
1313 return {
14- domain : window . location . host ,
14+ host : window . location . host ,
1515 pathname : window . location . pathname ,
1616 }
1717}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export interface CommentEvent {
2424 * Avoids dependency on global window/location objects for better testability.
2525 */
2626export interface StrippedLocation {
27- domain : string
27+ host : string
2828 pathname : string
2929}
3030
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export class GitHubIssueAddCommentEnhancer implements CommentEnhancer<GitHubIssu
2727 if ( textarea . id === 'feedback' ) {
2828 return null
2929 }
30- if ( location . domain !== 'github.com' ) {
30+ if ( location . host !== 'github.com' ) {
3131 return null
3232 }
3333
@@ -44,7 +44,7 @@ export class GitHubIssueAddCommentEnhancer implements CommentEnhancer<GitHubIssu
4444 const unique_key = `github.com:${ slug } :${ number } `
4545 const title = 'TODO_TITLE'
4646 return {
47- domain : location . domain ,
47+ domain : location . host ,
4848 number,
4949 slug,
5050 title,
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export class GitHubIssueNewCommentEnhancer implements CommentEnhancer<GitHubIssu
2020 _textarea : HTMLTextAreaElement ,
2121 location : StrippedLocation ,
2222 ) : GitHubIssueNewCommentSpot | null {
23- if ( location . domain !== 'github.com' ) {
23+ if ( location . host !== 'github.com' ) {
2424 return null
2525 }
2626
@@ -35,7 +35,7 @@ export class GitHubIssueNewCommentEnhancer implements CommentEnhancer<GitHubIssu
3535 const slug = `${ owner } /${ repo } `
3636 const unique_key = `github.com:${ slug } :new`
3737 return {
38- domain : location . domain ,
38+ domain : location . host ,
3939 slug,
4040 type : 'GH_ISSUE_NEW_COMMENT' ,
4141 unique_key,
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export class GitHubPRAddCommentEnhancer implements CommentEnhancer<GitHubPRAddCo
2424 location : StrippedLocation ,
2525 ) : GitHubPRAddCommentSpot | null {
2626 // Only handle github.com domains TODO: identify GitHub Enterprise somehow
27- if ( location . domain !== 'github.com' || _textarea . id !== 'new_comment_field' ) {
27+ if ( location . host !== 'github.com' || _textarea . id !== 'new_comment_field' ) {
2828 return null
2929 }
3030
@@ -40,7 +40,7 @@ export class GitHubPRAddCommentEnhancer implements CommentEnhancer<GitHubPRAddCo
4040 const unique_key = `github.com:${ slug } :${ number } `
4141 const title = 'TODO_TITLE'
4242 return {
43- domain : location . domain ,
43+ domain : location . host ,
4444 number,
4545 slug,
4646 title,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export class GitHubPRNewCommentEnhancer implements CommentEnhancer<GitHubPRNewCo
2323 if ( textarea . id === 'feedback' ) {
2424 return null
2525 }
26- if ( location . domain !== 'github.com' ) {
26+ if ( location . host !== 'github.com' ) {
2727 return null
2828 }
2929
@@ -43,7 +43,7 @@ export class GitHubPRNewCommentEnhancer implements CommentEnhancer<GitHubPRNewCo
4343 : `${ owner } /${ repo } /${ compareBranch } `
4444 const unique_key = `github.com:${ slug } `
4545 return {
46- domain : location . domain ,
46+ domain : location . host ,
4747 slug,
4848 type : 'GH_PR_NEW_COMMENT' ,
4949 unique_key,
Original file line number Diff line number Diff line change @@ -334,7 +334,7 @@ function injectGitcassoScript(key: keyof typeof PAGES, html: string) {
334334 /function detectLocation(): StrippedLocation {[sS]*?}/,
335335 'function detectLocation() {\\n' +
336336 ' return {\\n' +
337- ' domain : \\'${ urlParts . host } \\',\\n' +
337+ ' host : \\'${ urlParts . host } \\',\\n' +
338338 ' pathname: \\'${ urlParts . pathname } \\'\\n' +
339339 ' };\\n' +
340340 '}'
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const enhancers = new EnhancerRegistry()
1010function enhancements ( document : Document , window : Window ) {
1111 const textareas = document . querySelectorAll ( 'textarea' )
1212 const location : StrippedLocation = {
13- domain : window . location . host ,
13+ host : window . location . host ,
1414 pathname : window . location . pathname ,
1515 }
1616 const spotsFound = [ ]
You can’t perform that action at this time.
0 commit comments