Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 57b7a8fd1b43ae75c6b0b315a42d5cd9f78d4355 1 parent 4171e66
@chromakode chromakode authored
Showing with 7 additions and 2 deletions.
  1. +2 −2 src/manifest.json
  2. +5 −0 src/pageOverlay.js
View
4 src/manifest.json
@@ -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
5 src/pageOverlay.js
@@ -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)
},
Please sign in to comment.
Something went wrong with that request. Please try again.