Merge pull request #27 from hideheader/iframe-splatter

Only push styles to the top-level document.
This commit is contained in:
Jason Barnabe 2015-02-17 12:50:26 -06:00
commit 6c24362343

View File

@ -1,6 +1,7 @@
// This happens right away, sometimes so fast that the content script isn't even ready. That's // This happens right away, sometimes so fast that the content script isn't even ready. That's
// why the content script also asks for this stuff. // why the content script also asks for this stuff.
chrome.webNavigation.onCommitted.addListener(function(data) { chrome.webNavigation.onCommitted.addListener(function(data) {
if (data.frameId !== 0) return;
getStyles({matchUrl: data.url, enabled: true, asHash: true}, function(styleHash) { getStyles({matchUrl: data.url, enabled: true, asHash: true}, function(styleHash) {
chrome.tabs.sendMessage(data.tabId, {method: "styleApply", styles: styleHash}); chrome.tabs.sendMessage(data.tabId, {method: "styleApply", styles: styleHash});
// Don't show the badge for frames // Don't show the badge for frames