File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,20 +98,21 @@ function triggerGitHubLink (backgroundOrNot) {
9898
9999// Go to selected email GitHub thread
100100function generateUrlAndGoTo ( selected , regexp ) {
101- // If the title looks like a GitHub notification email.
102- if ( ( title = selected . innerText . match ( / \[ ( .* ) \] \s .* \s \( \# ( \d * ) \) / ) ) ) {
101+ gotoaction = selected . querySelectorAll ( '.aKS [role="button"]' ) [ 0 ]
103102
103+ if ( gotoaction ) {
104+ // if there's a gotoaction
105+ gotoaction . dispatchEvent ( fakeEvent ( 'mousedown' ) )
106+
107+ } else if ( ( title = selected . innerText . match ( / \[ ( .* ) \] \s .* \s \( \# ( \d * ) \) / ) ) ) {
108+ // If the title looks like a GitHub notification email.
104109 // org name coms from a label
105110 regexp = new RegExp ( regexp )
106- label = selected . querySelectorAll ( '.av' ) [ 0 ]
107- if ( label ) org = label . innerText . toLowerCase ( ) . match ( regexp )
111+ label = selected . querySelectorAll ( '.av' ) [ 0 ]
108112
109- // quick action ?!
110- gotoaction = selected . querySelectorAll ( '.aKS [role="button"]' ) [ 0 ]
113+ if ( label ) org = label . innerText . toLowerCase ( ) . match ( regexp )
111114
112- if ( gotoaction ) {
113- gotoaction . dispatchEvent ( fakeEvent ( 'mousedown' ) )
114- } else if ( org ) {
115+ if ( org ) {
115116 org = org [ 1 ]
116117 repo = title [ 1 ]
117118 issue_no = title [ 2 ]
You can’t perform that action at this time.
0 commit comments