Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot get tab title

I am working on a browser extension for which I need to know the current tab title. I manage to find the title from the the HTML page code but, from after documenting more about this I have found that there are easier ways to do this.

I have tried the following ways:

selectedTabTitle = $(ui.tab).text(); 

and

selectedTabTitle = document.title;

but neither work. I must note that I am using kango-framework to make this extension.

like image 451
Vlad Vlad Avatar asked Aug 10 '26 22:08

Vlad Vlad


1 Answers

document.title should work or $('title').text()

are you maybe working with iframes? In that case the title of the iframe will be returned.

here an example:

first one shows the code, second one, so that it is not launched in an iframe

http://jsfiddle.net/56deD/

http://jsfiddle.net/56deD/show/

like image 122
cytofu Avatar answered Aug 13 '26 12:08

cytofu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!