Skip to content

Commit

Permalink
Further refinement, fix Chrome top bar item color
Browse files Browse the repository at this point in the history
  • Loading branch information
jklaiho committed Mar 3, 2012
1 parent f3eb581 commit 1b593c5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,5 +5,6 @@ chrome/build/UnFuckGoogle.pem
# Ignore build products and copies of the CSS...
UnFuckGoogle.css
UnFuckGoogle.js
UnFuckGoogleSetup.js
# ...but don't ignore the master CSS file at repo root
!/UnFuckGoogle.css
12 changes: 9 additions & 3 deletions Cakefile
Expand Up @@ -18,13 +18,16 @@ distDirs = {
coffeeSources = {
'safari': {
'UnFuckGoogle': [
"safari/preflight.coffee"
'safari/preflight.coffee'
'UnFuckGoogle.coffee'
]
}
},
'chrome': {
'UnFuckGoogleSetup': [
'chrome/setup.coffee'
],
'UnFuckGoogle': [
"chrome/preflight.coffee"
'chrome/preflight.coffee'
'UnFuckGoogle.coffee'
]
}
Expand Down Expand Up @@ -96,7 +99,10 @@ task('clean', "Remove the products of any previous build runs (successful or fai
"#{safBd}/_safari_UnFuckGoogle_temp.js"

"#{chrBd}/UnFuckGoogle.css"
"#{chrBd}/UnFuckGoogleSetup.js"
"#{chrBd}/UnFuckGoogle.js"
"#{chrBd}/_chrome_UnFuckGoogleSetup_temp.coffee"
"#{chrBd}/_chrome_UnFuckGoogleSetup_temp.js"
"#{chrBd}/_chrome_UnFuckGoogle_temp.coffee"
"#{chrBd}/_chrome_UnFuckGoogle_temp.js"
].map(rm)
Expand Down
2 changes: 0 additions & 2 deletions UnFuckGoogle.coffee
Expand Up @@ -26,8 +26,6 @@ UnFuckGoogle = ->
removeRedirectOnmousedowns()
document.addEventListener('DOMNodeInsertedIntoDocument', removeRedirectOnmousedowns, true)

document.getElementsByClassName('gbzt gbz0l')[0].className = 'gbzt'

#
# +1 Button removal
#
Expand Down
6 changes: 5 additions & 1 deletion UnFuckGoogle.css
Expand Up @@ -33,5 +33,9 @@ div#gbx3 {
}

#cnt #center_col, #cnt #foot, #cnt .ab_center_col {
width: auto;
width: auto !important;
}

.s {
max-width: 48em !important;
}
6 changes: 6 additions & 0 deletions chrome/build/UnFuckGoogle/manifest.json
Expand Up @@ -4,6 +4,12 @@
"description": "Removes various annoyances from Google",
"update_url": "http://files.jklaiho.net/UnFuckGoogle/chrome/updates.xml",
"content_scripts": [
{
"matches": ["<all_urls>"],
"include_globs": ["http*://*.google.*/*"],
"js": ["UnFuckGoogleSetup.js"],
"run_at": "document_start"
},
{
"matches": ["<all_urls>"],
"include_globs": ["http*://*.google.*/*"],
Expand Down
8 changes: 8 additions & 0 deletions chrome/setup.coffee
@@ -0,0 +1,8 @@
document.addEventListener("DOMContentLoaded", ->
# Google uses a "color: #fff !important" CSS clause on the currently
# selected top bar element. For some reason (probably extension element
# loading order technicalities), in Chrome our style override in
# UnFuckGoogle.css is not getting precedence. So, set the style on the
# element itself for maximum specificity.
document.getElementsByClassName('gbz0l')[0].lastChild.setAttribute('style', 'color:black !important')
, false)

0 comments on commit 1b593c5

Please sign in to comment.