Recently I got a request in the mail from a user of one of my Firefox add-ons. He asked me if I could make an add-on that displayed the url of the current tab in the titlebar instead of the actual title of the page being shown. I’m not interested in creating more add-ons for Firefox or Thunderbird, they take up quite a lot of time with user requests, getting approved by the Mozilla addons site, etc. That is why I’ve discontinued 6 out of the 9 add-ons I’ve created. But anyway, I knew that it would be trivial to make this add-on so I decided to help this person out.
You can download the add-on here. This add-on will never be updated or published on AMO, it is offered strictly as-is. The one thing I found interesting about this was figuring out how to do the absolute minimum to get this add-on working. There is no localization, no folder structure, just three files, install.rdf, chrome.manifest and url2titlebar.xul. Put those into a zip file, rename it to .xpi and you have your extension. These of course are not best practices in extension development, just an exercise in making the simplest extension possible. Below is the full content of the three files:
<?xml version="1.0" encoding="UTF-8"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script>
window.addEventListener('load', function() {
function setTitle() {
document.title = gBrowser.selectedBrowser.contentDocument.location;
}
gBrowser.tabContainer.addEventListener('TabSelect', setTitle, false);
document.addEventListener('pageshow', setTitle, false);
setTitle();
},false);
</script>
</overlay>
content url2titlebar file:./ overlay chrome://browser/content/browser.xul chrome://url2titlebar/content/url2titlebar.xul
install.rdf
<?xml version="1.0" encoding="UTF-8"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>url2titlebar@einaregilsson.com</em:id>
<em:name>URL-2-Titlebar</em:name>
<em:version>0.0.1</em:version>
<em:creator>Einar Egilsson</em:creator>
<em:description>Set the title of the window to the current url</em:description>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- firefox -->
<em:minVersion>3.0</em:minVersion>
<em:maxVersion>3.5.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
So, there you have it, the simplest possible Firefox add-on. Enjoy!
Курорты болгарии– Аккуратный сайт о турах в таиланд.
- на доски интернета 10$ на 10000 досок или 15$ на 20000 досок
- в белые каталоги сайтов 10$ на 6000 каталогов
- на форумы 20$ на 30000 форумов
- 40$ на 60000 форумов
- рассылка вручную на любые сайты 0.2$ за регистрацию сбор сайтов входит в стоимость минимум 100 регистраций.
- рассылка на сайты определенной тематики 60$ повторные рассылки 20$
- “Умные” имэйл рассылки – собирается база e-mail потенциальных клиентов, организаций по теме,
а значит не является спамом 100$ первая (сбор+рассылка) повторные рассылки 20$-30$ базу отдаю Вам
- на доски, каталоги любого региона или города 20$ – 40$
- сбор баз любых сайтов, имэйлов
ver934@mail.ru
Сайт “Спроси у гадалки”. Результаты тестирования помогут тебе ответить на самые популярные вопросы: когда придет слава. Реальный результат! Проверено 100%!
Интернет-магазин по продаже мобильных телефонов и аксесуаров к ним. Большой ассортимент
товаров.Есть партнерская программа http://www.sotmarket.ru/product/219.html?ref=26634