Firefox Extension getting website Meta

Aha! I *finally* figured out how to have my Firefox extension get the Meta tags from the current webpage:


allMetas = window._content.document.getElementsByTagName("meta");

for(var i = 0; i < allMetas.length; i++)
{
if(allMetas[i].name == "METATAG")
{
// do something with METATAG
break;
}
}

THAT was annoying. Now I can finally finish up the ICBM/geo.position firefox extension.

About this article

written on
posted in Programming Back to Top

About the Author

Andrew Turner is an advocate of open standards and open data. He is actively involved in many organizations developing and supporting open standards, including OpenStreetMap, Open Geospatial Consortium, Open Web Foundation, OSGeo, and the World Wide Web Consortium. He co-founded CrisisCommons, a community of volunteers that, in coordination with government agencies and disaster response groups, build technology tools to help people in need during and after a crisis such as an earthquake, tsunami, tornado, hurricane, flood, or wildfire.