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 1
1
{
2
2
"name" : " twitch-auto-points" ,
3
- "version" : " 1.2.1 " ,
3
+ "version" : " 1.2.2 " ,
4
4
"description" : " Automatic twitch bonus point collection" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ browser.tabs.onRemoved.addListener((tabId) => {
185
185
const onContentScriptMessage = async ( message , sender ) => {
186
186
if ( sender . id === browser . runtime . id ) {
187
187
if ( message . type === 'add_points' ) {
188
- const channelId = new URL ( sender . url ) . pathname . split ( '/' ) . pop ( ) ;
188
+ const channelId = message . channelId ;
189
189
const pointsCollectedForChannel = extension . getChannelPoints ( channelId ) ;
190
190
const updatedAmount = pointsCollectedForChannel + message . bonus ;
191
191
extension . setChannelPoints ( channelId , updatedAmount ) ;
Original file line number Diff line number Diff line change @@ -57,9 +57,11 @@ function tryToGetReceivedPoints() {
57
57
if ( bonusAmount ) {
58
58
// slice to remove + at the beginning
59
59
const bonusAmountInt = parseInt ( bonusAmount . slice ( 1 ) , 10 ) ;
60
+ const channelId = document . querySelector ( '.tw-halo' ) ?. getAttribute ( 'href' ) . split ( '/' ) . pop ( ) ;
60
61
browser . runtime . sendMessage ( {
61
62
type : 'add_points' ,
62
- bonus : bonusAmountInt
63
+ bonus : bonusAmountInt ,
64
+ channelId
63
65
} ) ;
64
66
65
67
clearInterval ( pointsInterval ) ;
Original file line number Diff line number Diff line change 2
2
"manifest_version" : 2 ,
3
3
"author" : " Daniyil Vasylenko" ,
4
4
"name" : " Twitch Auto Points" ,
5
- "version" : " 1.2.1 " ,
5
+ "version" : " 1.2.2 " ,
6
6
"homepage_url" : " https://github.com/Spring3/twitch-auto-points" ,
7
7
"description" : " Automatic twitch channel points collection" ,
8
8
"permissions" : [
You can’t perform that action at this time.
0 commit comments