File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ browser.tabs.onRemoved.addListener((tabId) => {
185185const onContentScriptMessage = async ( message , sender ) => {
186186 if ( sender . id === browser . runtime . id ) {
187187 if ( message . type === 'add_points' ) {
188- const channelId = new URL ( sender . url ) . pathname . split ( '/' ) . pop ( ) ;
188+ const channelId = message . channelId ;
189189 const pointsCollectedForChannel = extension . getChannelPoints ( channelId ) ;
190190 const updatedAmount = pointsCollectedForChannel + message . bonus ;
191191 extension . setChannelPoints ( channelId , updatedAmount ) ;
Original file line number Diff line number Diff line change @@ -57,9 +57,11 @@ function tryToGetReceivedPoints() {
5757 if ( bonusAmount ) {
5858 // slice to remove + at the beginning
5959 const bonusAmountInt = parseInt ( bonusAmount . slice ( 1 ) , 10 ) ;
60+ const channelId = document . querySelector ( '.tw-halo' ) ?. getAttribute ( 'href' ) . split ( '/' ) . pop ( ) ;
6061 browser . runtime . sendMessage ( {
6162 type : 'add_points' ,
62- bonus : bonusAmountInt
63+ bonus : bonusAmountInt ,
64+ channelId
6365 } ) ;
6466
6567 clearInterval ( pointsInterval ) ;
You can’t perform that action at this time.
0 commit comments