Re: Passing dynamic variable from background to content script - MV3

42 views
Skip to first unread message
Message has been deleted

Abdullah Al Naiem

unread,
Jan 22, 2022, 5:29:59 PM1/22/22
to Chromium Extensions, Abdullah Al Naiem
For the clarification:
In MV2 I stored tab ID in an object priority[s].tab.id
and in MV3 the tab id was stored in a variable tabId

hrg...@gmail.com

unread,
Jan 22, 2022, 6:33:14 PM1/22/22
to Chromium Extensions, naie...@gmail.com
Are you sure that this code 
'var key = ' + backg ;
creates the backg variable in the target tab instead of the key variable?

Abdullah Al Naiem

unread,
Jan 22, 2022, 6:37:53 PM1/22/22
to Chromium Extensions, hrg...@gmail.com, Abdullah Al Naiem
Sorry, I made a silly mistake while formatting the code. There wasn't the semicolon
It should be 'var key = ' + backg


hrg...@gmail.com

unread,
Jan 22, 2022, 6:59:42 PM1/22/22
to Chromium Extensions, naie...@gmail.com, hrg...@gmail.com
Ok, that was a syntax error. But I insist with my question. That code doesn't seem to create the backg variable. Instead it create the key variable.
So, how are you then using the backg variable in execute.js if you never create that variable in the first place?

Abdullah Al Naiem

unread,
Jan 22, 2022, 7:40:17 PM1/22/22
to Chromium Extensions, hrg...@gmail.com, Abdullah Al Naiem
Hi, I made a few mistakes in this post. I'm going to repost it with corrections and delete the current post. I hope you'll get this reply with email notification.
And here's the new post link https://groups.google.com/a/chromium.org/g/chromium-extensions/c/z6mU7ByvB9w
Reply all
Reply to author
Forward
0 new messages