google-chrome-extension


How do we get the parent tab URL of the current chrome tab?


On my application home page, there is a link which opens a new tab when clicked.
After some research, I found below code which gets triggered when a new chrome tab is launched. The "active_tab" object below gives information about the current tab.
But how do we get the Parent tab URL (previous active tab) here ? Please help.
I need to get my Home page url here from which this active_tab is launched.
chrome.tabs.onActivated.addListener(function(activeInfo) {
chrome.tabs.get(activeInfo.tabId, function(active_tab){
alert(active_tab.url);
/* code */
});
});
Thanks #wOxxOm.
Used the openerTabId property to get parent tab.
chrome.tabs.onActivated.addListener(function(activeInfo) {
chrome.tabs.get(activeInfo.tabId, function(active_tab){
chrome.tabs.get(active_tab.openerTabId, function(parent_tab){
alert(parent_tab.url);
});
});
});

Related Links

How to access e-mail headers
How yo create new tab and modify it
chrome file system inspection - reload on change
How do I `addRules` for the `declarativeContent` API with chrome.dart
How to create Chrome notification for my changes in website?
Chrome/firefox extension to read data streaming over USB and network to localhost
Chrome new tab via URL
Refused to set unsafe header “User-Agent” - Chrome Extension
Could someone explain this coffeescript syntax to me?
Chrome extension with integrated indexdb database
How to trigger onDownloadProgress while installing Chrome Extension?
Chrome extansion “default_icon” strange orange background
content script - window.location.href = url_b; lands on about:blank page
chrome extension doesn't work on “about:blank” URL
Launch a local file with default file handler from chrome packaged app (or extension)
[Javascript]Passing local vars as parameters to EnventListener Click

Categories

HOME
ibm-bluemix
openlayers
single-sign-on
reserved
platform-builder
fme
bookshelf.js
gis
icloud
disassembler
ebean
azure-storage-tables
append
node-pdfkit
size
percona
uitypeeditor
ghc
finite-automata
interop
dbext
visjs
ml
java-3d
physics-engine
tokenize
core-text
crosstab
numerical-methods
maquette
log4js-node
kendo-datasource
y86
disassembling
retina-display
hot-module-replacement
ansible-playbook
trim
broadcastreceiver
ruby-on-rails-3.1
vao
acoustics
qcombobox
executenonquery
revapi
blogengine.net
togetherjs
recursive-datastructures
carrot
lift-json
windows-mobile-6.5
mako
spring-mongodb
color-profile
blacklist
home-directory
phishing
skobbler-maps
pagerank
nessus
varargs
responsive-images
ami
umbraco6
block-device
oxwall
nstableviewcell
file-copying
asp.net-web-api-odata
phpthumb
mechanize-ruby
datagridviewcolumn
transcoding
viadeo
page-layout
aqtime
dexterity
jplaton
seed
angularjs-controller
funscript
bluepill
pysimplesoap
onsubmit
appconkit
ticoredatasync
enter
netbeans-6.9
spring-portlet-mvc
self-extracting
table-footer
winbugs14
asp.net-mvc-areas
web-application-design
ti-dsp
simpletest
dbisam

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html