We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ae37e0 commit 2c7fcc1Copy full SHA for 2c7fcc1
05 Build a Chrome Extension/index.js
@@ -14,7 +14,13 @@ if (leadsFromLocalStorage) {
14
const tabs = [{ url: "https://www.linkedin.com/in/junaidhassan19/" }];
15
16
tabBtn.addEventListener("click", function () {
17
- // Save the url instead of logging it out
+ // Grab the URL of the current tab!
18
+ chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
19
+ // since only one tab should be active and in the current window at once
20
+ // the return variable should only have one entry
21
+ let activeTab = tabs[0];
22
+ let activeTabId = activeTab.id; // or do whatever you need
23
+ });
24
myLeads.push(tabs[0].url);
25
localStorage.setItem("myLeads", JSON.stringify(myLeads));
26
render(myLeads);
0 commit comments