File tree Expand file tree Collapse file tree 4 files changed +6
-4
lines changed Expand file tree Collapse file tree 4 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " twitch-auto-points" ,
3- "version" : " 1.2.1 " ,
3+ "version" : " 1.2.2 " ,
44 "description" : " Automatic twitch bonus point collection" ,
55 "main" : " index.js" ,
66 "scripts" : {
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 ) ;
Original file line number Diff line number Diff line change 22 "manifest_version" : 2 ,
33 "author" : " Daniyil Vasylenko" ,
44 "name" : " Twitch Auto Points" ,
5- "version" : " 1.2.1 " ,
5+ "version" : " 1.2.2 " ,
66 "homepage_url" : " https://github.com/Spring3/twitch-auto-points" ,
77 "description" : " Automatic twitch channel points collection" ,
88 "permissions" : [
You can’t perform that action at this time.
0 commit comments