Permalink
Browse files

Fix image page shine bar display issue.

It appears that the CSS defined in the manifest content script is no
longer taking effect on image-only pages. Instead of relying on the
content script definition to provide the CSS, we'll take things into our
own hands and create a <link rel="stylesheet"> ourself.
  • Loading branch information...
chromakode committed Feb 21, 2013
1 parent 4171e66 commit 57b7a8fd1b43ae75c6b0b315a42d5cd9f78d4355
Showing with 7 additions and 2 deletions.
  1. +2 −2 src/manifest.json
  2. +5 −0 src/pageOverlay.js
View
@@ -31,11 +31,11 @@
{
"matches": ["http://*/*"],
"run_at": "document_start",
- "js": ["debug.js", "pageOverlay.js"],
- "css": ["pageOverlay.css"]
+ "js": ["debug.js", "pageOverlay.js"]
}
],
"web_accessible_resources": [
+ "pageOverlay.css",
"bar.html",
"submit.html",
"images/reddit-mail.svg",
View
@@ -17,7 +17,12 @@ ShineOverlay.prototype = {
this.frame = document.createElement('iframe')
this.frame.setAttribute('scrolling', 'no')
this.frame.setAttribute('frameborder', 'no')
+ this.stylesheet = document.createElement('link')
+ this.stylesheet.setAttribute('href', chrome.extension.getURL('pageOverlay.css'))
+ this.stylesheet.setAttribute('type', 'text/css')
+ this.stylesheet.setAttribute('rel', 'stylesheet')
this.overlay = document.createElement('shinebar')
+ this.overlay.appendChild(this.stylesheet)
this.overlay.appendChild(this.frame)
document.documentElement.appendChild(this.overlay)
},

0 comments on commit 57b7a8f

Please sign in to comment.