Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: jklaiho/UnFuckGoogle
base: 68e5601c24
...
head fork: jklaiho/UnFuckGoogle
compare: 1b593c5926
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 16 files changed
  • 0 commit comments
  • 1 contributor
View
4 .gitignore
@@ -4,7 +4,7 @@ chrome/build/UnFuckGoogle.crx
chrome/build/UnFuckGoogle.pem
# Ignore build products and copies of the CSS...
UnFuckGoogle.css
-start.js
-end.js
+UnFuckGoogle.js
+UnFuckGoogleSetup.js
# ...but don't ignore the master CSS file at repo root
!/UnFuckGoogle.css
View
46 Cakefile
@@ -17,23 +17,18 @@ distDirs = {
coffeeSources = {
'safari': {
- 'start': [
- 'UnFuckGoogleStart.coffee'
- "safari/start.coffee"
+ 'UnFuckGoogle': [
+ 'safari/preflight.coffee'
+ 'UnFuckGoogle.coffee'
]
- 'end': [
- 'UnFuckGoogleEnd.coffee'
- "safari/end.coffee"
- ]
- }
+ },
'chrome': {
- 'start': [
- 'UnFuckGoogleStart.coffee'
- "chrome/start.coffee"
- ]
- 'end': [
- 'UnFuckGoogleEnd.coffee'
- "chrome/end.coffee"
+ 'UnFuckGoogleSetup': [
+ 'chrome/setup.coffee'
+ ],
+ 'UnFuckGoogle': [
+ 'chrome/preflight.coffee'
+ 'UnFuckGoogle.coffee'
]
}
}
@@ -99,20 +94,17 @@ task('clean', "Remove the products of any previous build runs (successful or fai
chrBd = buildDirs['chrome']
[
"#{safBd}/UnFuckGoogle.css"
- "#{safBd}/start.js"
- "#{safBd}/end.js"
- "#{safBd}/_safari_start_temp.coffee"
- "#{safBd}/_safari_end_temp.coffee"
- "#{safBd}/_safari_start_temp.js"
- "#{safBd}/_safari_end_temp.js"
+ "#{safBd}/UnFuckGoogle.js"
+ "#{safBd}/_safari_UnFuckGoogle_temp.coffee"
+ "#{safBd}/_safari_UnFuckGoogle_temp.js"
"#{chrBd}/UnFuckGoogle.css"
- "#{chrBd}/start.js"
- "#{chrBd}/end.js"
- "#{chrBd}/_chrome_start_temp.coffee"
- "#{chrBd}/_chrome_start_temp.js"
- "#{chrBd}/_chrome_end_temp.coffee"
- "#{chrBd}/_chrome_end_temp.js"
+ "#{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)
)
View
1  README.markdown
@@ -12,6 +12,7 @@ The current features are as follows:
* remove the prompts to add your Twitter account to your Google profile
* remove history-breaking onmousedown handlers from result links that
transform the original link into a google.com redirect
+ * restore Cached and Similar links to their original position
* Global:
* restore the top navigation bar to its original white background
View
42 UnFuckGoogle.coffee
@@ -0,0 +1,42 @@
+UnFuckGoogle = ->
+ PREVIEW_CLASSDEF = 'vspib'
+ REDIRECT_CLASSDEFS = ['r', 'fc']
+ PLUSONE_CLASSDEF = 'esw eswd'
+
+ #
+ # Preview functionality removal
+ #
+ removePreviewActivators = ->
+ elems = document.getElementsByClassName(PREVIEW_CLASSDEF)
+ if elems.length > 0
+ for i in [elems.length-1..0]
+ elems[i].parentNode.removeChild(elems[i])
+ removePreviewActivators()
+ document.addEventListener('DOMNodeInsertedIntoDocument', removePreviewActivators, true)
+
+ #
+ # Result link to onmousedown-toggled google.com redirect removal
+ #
+ removeRedirectOnmousedowns = (containers) ->
+ for cls in REDIRECT_CLASSDEFS
+ elems = document.getElementsByClassName(cls)
+ for elem in elems
+ for link in elem.getElementsByTagName('a')
+ link.removeAttribute('onmousedown')
+ removeRedirectOnmousedowns()
+ document.addEventListener('DOMNodeInsertedIntoDocument', removeRedirectOnmousedowns, true)
+
+ #
+ # +1 Button removal
+ #
+ removePlusOnes = ->
+ buttons = document.getElementsByClassName(PLUSONE_CLASSDEF)
+ undoDivs = []
+ if buttons.length > 0
+ for i in [buttons.length-1..0]
+ undoDivs.push(document.getElementById(buttons[i].getAttribute('g:undo')))
+ buttons[i].parentNode.removeChild(buttons[i])
+ for i in [undoDivs.length-1..0]
+ undoDivs[i].parentNode.removeChild(undoDivs[i])
+ removePlusOnes()
+ document.addEventListener('DOMNodeInsertedIntoDocument', removePlusOnes, true)
View
34 UnFuckGoogle.css
@@ -1,9 +1,9 @@
-/* UnFuckGoogle Safari/Chrome Extension v1.1 by JK Laiho (jklaiho@iki.fi) */
-div#gb > div {
- background-color: transparent !important;
+/* UnFuckGoogle Safari/Chrome Extension by JK Laiho (jklaiho@iki.fi) */
+div#gbx3 {
+ background-color: white !important;
}
-#gbz .gbzt, #gbz .gbgt, #gbg .gbgt {
+#gbz .gbzt, #gbz .gbgt {
color: black !important;
}
@@ -15,15 +15,27 @@ div#gb > div {
background-color: #E5E5E5 !important;
}
-.gbts #gbi5 {
- background-position-x: -6px !important;
- background-position-y: -22px !important;
+.vspib {
+ display: none !important;
}
-.so.soi {
- display: none !important;
+.vshid {
+ display:inline !important;
}
-.vspib {
- display: none !important;
+.vshid:before {
+ content: " - ";
+}
+
+.vshid a {
+ color: #12C !important;
+ text-decoration: none !important;
+}
+
+#cnt #center_col, #cnt #foot, #cnt .ab_center_col {
+ width: auto !important;
+}
+
+.s {
+ max-width: 48em !important;
}
View
34 UnFuckGoogleEnd.coffee
@@ -1,34 +0,0 @@
-UnFuckGoogleEnd = ->
- PREVIEW_CLASSDEF = 'vspib'
- REDIRECT_CLASSDEFS = ['r', 'fc']
-
- #
- # Preview functionality removal
- #
-
- removePreviewActivators = (divs) ->
- if divs.length > 0
- for i in [divs.length-1..0]
- divs[i]?.parentNode.removeChild(divs[i])
-
- # Find and remove the preview activator divs that exist at page load
- previewActivators = document.getElementsByClassName(PREVIEW_CLASSDEF)
- removePreviewActivators(previewActivators)
-
- # Listen for DOM insertions and look for new preview activator divs
- showMorePreviewRemoval = ->
- newPreviewActivators = document.getElementsByClassName(PREVIEW_CLASSDEF)
- removePreviewActivators(newPreviewActivators)
- document.addEventListener('DOMNodeInsertedIntoDocument', showMorePreviewRemoval, true)
-
- #
- # Result link to onmousedown-toggled google.com redirect removal
- #
-
- removeRedirectOnmousedowns = (containers) ->
- for cls in REDIRECT_CLASSDEFS
- containers = document.getElementsByClassName(cls)
- for container in containers
- for link in container.getElementsByTagName('a')
- link.removeAttribute('onmousedown')
- document.addEventListener('DOMNodeInsertedIntoDocument', removeRedirectOnmousedowns, true)
View
19 UnFuckGoogleStart.coffee
@@ -1,19 +0,0 @@
-UnFuckGoogleStart = ->
- PLUSONE_CLASSDEF = 'esw eswd'
-
- removePlusOnes = (buttons) ->
- if buttons.length > 0
- for i in [buttons.length-1..0]
- undoDiv = document.getElementById(buttons[i].getAttribute('g:undo'))
- buttons[i].parentNode.removeChild(buttons[i])
- undoDiv.parentNode.removeChild(undoDiv)
-
- # Find and remove the +1 buttons that exist at page load
- plusOneButtons = document.getElementsByClassName(PLUSONE_CLASSDEF)
- removePlusOnes(plusOneButtons)
-
- # Listen for DOM insertions and look for new +1 buttons
- showMorePlusRemoval = ->
- newPlusOneButtons = document.getElementsByClassName(PLUSONE_CLASSDEF)
- removePlusOnes(newPlusOneButtons)
- document.addEventListener('DOMNodeInsertedIntoDocument', showMorePlusRemoval, true)
View
11 chrome/build/UnFuckGoogle/manifest.json
@@ -1,20 +1,25 @@
{
"name": "UnFuckGoogle",
- "version": "1.2",
+ "version": "1.2.2",
"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": ["start.js"],
+ "js": ["UnFuckGoogleSetup.js"],
+ "run_at": "document_start"
+ },
+ {
+ "matches": ["<all_urls>"],
+ "include_globs": ["http*://*.google.*/*"],
"css": ["UnFuckGoogle.css"],
"run_at": "document_end"
},
{
"matches": ["<all_urls>"],
"include_globs": ["http*://*.google.*/*"],
- "js": ["end.js"],
+ "js": ["UnFuckGoogle.js"],
"run_at": "document_idle"
}
]
View
2  chrome/build/updates.xml
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='mkaikjcglnbjbkhmnggbpanalpkpbgaf'>
- <updatecheck codebase='http://files.jklaiho.net/UnFuckGoogle/chrome/UnFuckGoogle.crx' version='1.2' />
+ <updatecheck codebase='http://files.jklaiho.net/UnFuckGoogle/chrome/UnFuckGoogle.crx' version='1.2.2' />
</app>
</gupdate>
View
2  chrome/end.coffee → chrome/preflight.coffee
@@ -1,3 +1,3 @@
if window.top == window
window.onload = ->
- UnFuckGoogleEnd()
+ UnFuckGoogle()
View
8 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)
View
4 chrome/start.coffee
@@ -1,4 +0,0 @@
-if window.top == window
- document.addEventListener("DOMContentLoaded", ->
- UnFuckGoogleStart()
- true)
View
10 safari/UnFuckGoogle.safariextension/Info.plist
@@ -13,9 +13,9 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
- <string>1.2.1</string>
+ <string>1.2.2</string>
<key>CFBundleVersion</key>
- <string>1.2.1</string>
+ <string>1.2.2</string>
<key>Chrome</key>
<dict/>
<key>Content</key>
@@ -24,11 +24,7 @@
<dict>
<key>End</key>
<array>
- <string>end.js</string>
- </array>
- <key>Start</key>
- <array>
- <string>start.js</string>
+ <string>UnFuckGoogle.js</string>
</array>
</dict>
<key>Stylesheets</key>
View
4 safari/dist/UnFuckGoogle.plist
@@ -10,9 +10,9 @@
<key>Developer Identifier</key>
<string>B9695YS625</string>
<key>CFBundleVersion</key>
- <string>1.2.1</string>
+ <string>1.2.2</string>
<key>CFBundleShortVersionString</key>
- <string>1.2.1</string>
+ <string>1.2.2</string>
<key>URL</key>
<string>http://files.jklaiho.net/UnFuckGoogle/safari/UnFuckGoogle.safariextz</string>
</dict>
View
2  safari/end.coffee → safari/preflight.coffee
@@ -5,4 +5,4 @@ if window.top == window
subdomain = document.domain.split('.')[0]
if tehGoogles.test(document.domain)
window.onload = ->
- UnFuckGoogleEnd()
+ UnFuckGoogle()
View
9 safari/start.coffee
@@ -1,9 +0,0 @@
-# The Safari extension builder doesn't support the use of TLD wildcards, so
-# we need to do the domain wildcarding here.
-if window.top == window
- tehGoogles = /\.google\.\w+(\.\w+)?$/
- subdomain = document.domain.split('.')[0]
- if tehGoogles.test(document.domain)
- document.addEventListener("DOMContentLoaded", ->
- UnFuckGoogleStart()
- true)

No commit comments for this range

Something went wrong with that request. Please try again.