Get current tab URL in background script

1,771 views
Skip to first unread message

NoobStudios

unread,
Sep 7, 2017, 6:17:26 PM9/7/17
to Chromium-Extensions-Announce
Title ^^

I'm very new to chrome extensions and i need to get the current tab's URL in the background.js script. Cheers

PhistucK

unread,
Sep 8, 2017, 5:46:40 AM9/8/17
to NoobStudios, Chromium-Extensions-Announce
I think this is the way -
 {
  lastFocusedWindow: true,
  active: true
 },
 function (tabs)
 {
  // tabs probably has only one item.
  console.log(tabs);
  // Do stuff with tabs.
 });


PhistucK

On Fri, Sep 8, 2017 at 1:17 AM, NoobStudios <worldoftanksreviewer@gmail.com> wrote:
Title ^^

I'm very new to chrome extensions and i need to get the current tab's URL in the background.js script. Cheers

--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsubscribe...@chromium.org.
To post to this group, send email to chromium-extensions@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/2086233d-76da-4b33-afde-c69f5e1e5bed%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Reply all
Reply to author
Forward
0 new messages