Firefox kengaytmasidan veb-saytlarning favicon urlini olib tashlash

Yuklanganidan keyin veb-saytning favicon urlini olishni istayman. Firefox kengaytmasi uchun buni qanday amalga oshirishim mumkin.

0

2 javoblar

Siz nsIFaviconService dan foydalanishingiz mumkin, u ma'lum sahifalar uchun faviconlarni kesh qiladi. Ushbu yo'nalishlarda:

var faviconService = Components.classes["@mozilla.org/browser/favicon-service;1"]
                               .getService(Components.interfaces.nsIFaviconService);
var favicon = faviconService.getFaviconImageForPage(gBrowser.currentURI);
alert(favicon.spec);

Shuni esda tutingki, u nsIURI moslamalarni bilan ishlaydi. nsIURI olish uchun nsIIOService.newURI() dan foydalanishingiz mumkin ob'ektini mag'lubiyatga uchratish.

Ha, men karthikning javobini takrorlab borayotganimni tushunaman - lekin hech qanday izoh va faqat soxta kod misoli yo'q.

2
qo'shib qo'ydi

https://developer.mozilla.org/en/nsIFaviconService https://developer.mozilla.org/en/Using_the_Places_favicon_service

Iltimos, sahifani diqqat bilan o'qing. Quyida ko'rsatilgan xizmatdan foydalanishingiz mumkin:

nsIServiceManager serviceManager = 
Mozilla.getInstance().getServiceManager(); 
nsIFaviconService service = 
(nsIFaviconService)serviceManager.getServiceByContractID("@mozilla.org/brows 
er/favicon-service;1", nsIFaviconService.NS_IFAVICONSERVICE_IID); 
0
qo'shib qo'ydi
Javascript UZB
Javascript UZB
99 ishtirokchilar

@js_uzb @vuejs_uz @react_uz @nodejs_uz @angular_uz @ngTashkent @yiiframework_uz @laravel_uz @linux_uzbek @python_uz @swift_uzb —————— @uzdevgroup @UzGeeksGroup ——— @UzDev_Jobs @jobs_uzb