The Code
This user script runs on all web pages. It relies on the fact that Firefox maintains a global list of stylesheets, document.styleSheets (note the camelCase capitalization).
There is just one problem: if the page defines additional styles inline, such as with a <style> element in the <head> of the page, or in a style attribute on one specific element, Firefox creates a separate entry for each style in the document.styleSheets list, using the page's URL as the address of the stylesheet (which is technically true, but unhelpful for our purposes). As we loop through document.styleSheets, we need to check for this condition and filter out stylesheets that point back to the current page.
Save the following user script as showstylesheets.user.js:
// ==UserScript==
// @name Show Stylesheets
// @namespace http://diveintomark.org/projects/greasemonkey/
// @description adds links to all of page's stylesheets
// @include http://*
// @include https://*
// ==/UserScript==
var arHtmlStylesheetLinks = new Array();
for (var i = document.styleSheets.length - 1; i >= 0; i--) {
var oStylesheet = document.styleSheets[i];
if (oStylesheet.href == location.href) continue;
var ssMediaText = oStylesheet.media.mediaText;
if (ssMediaText) {
ssMediaText = 'media="' + ssMediaText + '"';
}
arHtmlStylesheetLinks.push('<a title="' +
ssMediaText + '" href="' +
oStylesheet.href + '">' +
oStylesheet.href.split('/').pop() + '</a>');
}
if (!arHtmlStylesheetLinks.length) return;
var elmWrapperDiv = document.createElement('div');
elmWrapperDiv.innerHTML = 'Stylesheets: ' +
arHtmlStylesheetLinks.join(' · ');
elmWrapperDiv.style.textAlign = 'center';
elmWrapperDiv.style.fontSize = 'small';
elmWrapperDiv.style.fontFamily = 'sans-serif';
document.body.insertBefore(elmWrapperDiv, document.body.firstChild);