Add-on to exclude domains from right-click?

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15651
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Add-on to exclude domains from right-click?

Post by ChrisGreaves »

agibsonsw wrote:I think I got it working. Enter the following into Notepad and save as an .HTML file. Open this page in your browser and then drag the link onto your bookmarks toolbar.
Move Over, Hans! (grin!!)

A Gibson of London SW - you have just won a month's supply of cabbage rolls. Shipping Address please.

This works. I tried it with my "Access the value you entered doesn't meet the validation rules" and got no expert-exchange.

I know that I can set up a small set of filters, load them to a toolbar, and use anyone of them to initiate a search.

Well Done! :clapping: :clapping: :clapping:
He who plants a seed, plants life.

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Add-on to exclude domains from right-click?

Post by agibsonsw »

Thank you v much. Look forward to them!

You should include a space within the quotes " -site:etc.com"

I also wanted to say "You didn't select any text." The apostrophe needs to be entity referenced: "You didn't select any text."
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
PaulB
BronzeLounger
Posts: 1598
Joined: 26 Jan 2010, 20:28
Location: Ottawa ON

Re: Add-on to exclude domains from right-click?

Post by PaulB »

ChrisGreaves wrote:Does "you would never be able to link to them" refer to inhibition of the r/c new tab? Or would one have to suffer a pop-up message box saying "Sorry, not allowed" or the like?
The tab would open but with a message to the effect that it could not connect to site such-and-such.
Regards,
Paul

The pessimist complains about the wind. The optimist expects it to change. The realist adjusts his sails.

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Add-on to exclude domains from right-click?

Post by agibsonsw »

To complete the picture :evilgrin: the following version will open the search results in a new tab (or window):

Code: Select all

<a href='javascript:q = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt("You didn&apos;t select any text.  Enter a search phrase:", ""); if (q!=null) window.open("http://www.google.com/search?q=" + escape(q).replace(/ /g, "+")+" -site:experts-exchange.com"); void 0'>My Google</a>
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15651
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Add-on to exclude domains from right-click?

Post by ChrisGreaves »

agibsonsw wrote:To complete the picture :evilgrin: the following version will open the search results in a new tab (or window):
Wow! This morning we weren't even in beta and now we are at v 3.0! :cloud9:
I think this is striving for first place in my heart along with multiple screens.

I'm doubly-impressed because I don't recall seeing anything like this during my strolls through the web this morning.
He who plants a seed, plants life.

User avatar
jscher2000
2StarLounger
Posts: 148
Joined: 26 Dec 2010, 18:17

Re: Add-on to exclude domains from right-click?

Post by jscher2000 »

An alternate approach would be to use an add-on like the GreaseMonkey extension to tweak the search results page. For example, a userscript could gray out undesired search results or hide them. This wouldn't be as efficient as excluding those sites in the first place, in that you would have to go deeper into the results to get 10 good pages, but it has the potential to accommodate some of the other desired features, such as a "hide this site from now on" button (and a "stop hiding this site" button). But... considering how often Google seems to change the search page, maybe this kind of script would break too often...

User avatar
Hey Jude
5StarLounger
Posts: 1015
Joined: 24 Jan 2010, 15:45
Location: Ohio, U.S.A.

Re: Add-on to exclude domains from right-click?

Post by Hey Jude »

I finally managed to save it to html in Notepad and then dragged it to FF bookmark bar, and then opened it and
"My Google" showed up and when I clicked it I got a text box so I typed that and got all these results.

This is what shows up when I Googled "antivirus programs to run on a USB" -site:experts-exchange.com

and that's what showed up-site:experts-exchange.com

So I presume I made it work?
♫...Take a sad song and make it better . . .♫ Image

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15651
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Add-on to exclude domains from right-click?

Post by ChrisGreaves »

Hey Jude wrote:This is what shows up when I Googled "antivirus programs to run on a USB" -site:experts-exchange.com
and that's what showed up-site:experts-exchange.com
:sad: Perhaps not.
I pasted your search text antivirus programs to run on a USB into the searchbox which came pre-loaded with the "experts-exchange" exclusion and got these results:
2.png
As a further test I changed the -site to be +site and reran the search, which this time returned hits only from experts-exchange.
To go back a few steps, when I click on the bookmark menu and hover the mouse over the link, here is what I see (the link shows up with a portion of the javascript)
3.png
When I continue and click on that menu item, AGibsonSW's javascript executes and a little search box opens up as shown below:
4.png
Into this I type my search terms, but not the site-exclusions stuff; the javascript will add that automatically to each search.

Does this help?
(Like you, I hate these learning-hurdles)
This is a great time-saver and well worth getting working.
You do not have the required permissions to view the files attached to this post.
He who plants a seed, plants life.

User avatar
Hey Jude
5StarLounger
Posts: 1015
Joined: 24 Jan 2010, 15:45
Location: Ohio, U.S.A.

Re: Add-on to exclude domains from right-click?

Post by Hey Jude »

Yes, so I saved the file and when I opened it from FF bookmarks toolbar I and it gave this screen

Then I typed into the little box that came up--looked just like yours and typed German War Planes
Code screen box to type into.png
Then I got the Google Page of results
Code 3 results of Google search.png
SO I will study your shots to better figure out what happened, but I thought I ended up with the same result--having it show the -site:experts-exchange.com at the end of the results. Gotta think upon this some more.

Are you saying that the html goes in the navigation bar, which I did, and then I got the My Google screen and the little box and the results. OK so how do I get the file to run so it gives the google search in the navigation bar where you then type the search request? I am missing something here about saving it...I saved it to HTML but just named it "code" but saved it to my documents..should I save it elsewhere?
You do not have the required permissions to view the files attached to this post.
Last edited by Hey Jude on 12 Jan 2011, 13:40, edited 1 time in total.
♫...Take a sad song and make it better . . .♫ Image

User avatar
Hey Jude
5StarLounger
Posts: 1015
Joined: 24 Jan 2010, 15:45
Location: Ohio, U.S.A.

Re: Add-on to exclude domains from right-click?

Post by Hey Jude »

I dragged the file from my notepad to my bookmarks toolbar so when I click it it does open in the navigation bar, but doesn't give the GOOGLE like you have in the bar...I get that totally white screen with "My Google" at the top of it and when I double click that --then I get the search little box like you showed and I showed. Then I get the results...so perhaps I need steps for saving and what to do with it to get it in the right place

So then I entered NASA Satellite images of Venus in the search bar and got this
Nasa Satellite search.png
Edit:
latest Google search pane i.png
for privacy of information
You do not have the required permissions to view the files attached to this post.
Last edited by Hey Jude on 12 Jan 2011, 14:00, edited 2 times in total.
♫...Take a sad song and make it better . . .♫ Image

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Add-on to exclude domains from right-click?

Post by agibsonsw »

Copy the code into Notepad and save it as something.html.
In your browser choose File, Open (or equivalent) and open this file.
Drag the 'My Google' link from the page up onto your Bookmarks toolbar.
If you select text and then press the bookmark it should search for that text (without experts exchange).
If you don't select any text firstly, when you click 'My Google' you can enter text at that time.

Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15651
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Add-on to exclude domains from right-click?

Post by ChrisGreaves »

Hey Jude wrote:Yes, so I saved the file and when I opened it from FF bookmarks toolbar I and it gave this screen ... SO I will study your shots to better figure out what happened, but I thought I ended up with the same result--having it show the -site:experts-exchange.com at the end of the results. Gotta think upon this some more.
I see several posts, and will reply to each one in turn.

This post is encouraging, and you see what I saw when I first experimented.
I had saved the javascript code to a file (in my case B:\1.html) and then in FF chose File, Open and navigated to B:\1.html.
The file when opened gave me a page with just a hyperlink "My Google" on it.
1.png
I clicked on the hyperlink, got the empty search box, typed in my search terms, got the results, and ran around the room about twenty times waving my hands in the air.
From my point of view this step told me that I'd pasted in the code correctly.
(Of course I never had the slightest doubt that the code would work!)

My next step was to left-click and drag that hyperlink "My Google" up to the toolbar.
True Confession time: I didn't drag it to the preferred place first time off, but it got lodged somewhere; I made the "Search" toolbar a few minutes later.

At this stage I closed and reopened FF and found the spot in the toolbar where the link had ended up (somewhere in the "Weather" system of menus!), clicked on it and was rewarded with the same little pop-up text box.
Keyed in search terms, got results.
On to the next post ...
You do not have the required permissions to view the files attached to this post.
He who plants a seed, plants life.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15651
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Add-on to exclude domains from right-click?

Post by ChrisGreaves »

Hey Jude wrote:I dragged the file from my notepad to my bookmarks toolbar so when I click it it does open in the navigation bar, ...
Second post.
You are/were on the right track here, sort-of.
I didn't drag the html file anywhere.
I opened the html file in FF (File, Open, ...) which gave me the white screen with the hyperlink standing alone yet proud.
I then dragged that hyperlink to the toolbar.
He who plants a seed, plants life.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15651
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Add-on to exclude domains from right-click?

Post by ChrisGreaves »

agibsonsw wrote:If you select text and then press the bookmark it should search for that text (without experts exchange).
Andy.
Hoo-WOW!
I had missed this yesterday.
HeyJude: Do what Andy says.
This is way better than cabbage rolls.
I have now dragged the "MyGoogle" button to the top left corner of the system, for ease of access.
Select text, click the button.
neat!
Thanks Andy.
2.png
You do not have the required permissions to view the files attached to this post.
He who plants a seed, plants life.

User avatar
Hey Jude
5StarLounger
Posts: 1015
Joined: 24 Jan 2010, 15:45
Location: Ohio, U.S.A.

Re: Add-on to exclude domains from right-click?

Post by Hey Jude »

ChrisGreaves wrote: This post is encouraging, and you see what I saw when I first experimented.
I had saved the javascript code to a file (in my case B:\1.html) and then in FF chose File, Open and navigated to B:\1.html.
The file when opened gave me a page with just a hyperlink "My Google" on it.
1.png
I clicked on the hyperlink, got the empty search box, typed in my search terms, got the results, and ran around the room about twenty times waving my hands in the air.
From my point of view this step told me that I'd pasted in the code correctly.
(Of course I never had the slightest doubt that the code would work!)

My next step was to left-click and drag that hyperlink "My Google" up to the toolbar.
True Confession time: I didn't drag it to the preferred place first time off, but it got lodged somewhere; I made the "Search" toolbar a few minutes later.

At this stage I closed and reopened FF and found the spot in the toolbar where the link had ended up (somewhere in the "Weather" system of menus!), clicked on it and was rewarded with the same little pop-up text box.
Keyed in search terms, got results.
On to the next post ...
Ok. So I saved it correctly WHEW 'cause the link on my bar showed basically what yours showed, just was differently named. GOOD.

I dragged it to toolbar and I renamed it "My Google" and I was using it from there, but got confused so tried to put it in the bookmarks toolbar by organizing bookmarks--making a new folder called "Search" (like yours) but when I found it at the bottom of the list, I kept dragging it up and up until it disappeared as well. I did this 3x and gave up. I figured, it was already in my toolbar right in the middle of my other important bookmarks so I figured I would leave well enough alone. Thanks for the clarification. I was excited that it worked, I should have taken a screen shot the first time because I didn't explain it very well. I DID'NT close and reopen FF and I haven't found where my "Search" folder went, but I did find it in "Recently bookmarked" so it's there. It works when I use it so I'm happy.

What do you mean about "select text" it should search...not sure what this means, but it obviously is significant if it's better than cabbage rolls!!!!
♫...Take a sad song and make it better . . .♫ Image

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15651
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Add-on to exclude domains from right-click?

Post by ChrisGreaves »

Hey Jude wrote:what yours showed, just was differently named. GOOD.
I generally don't sweat the name, displayed text or location etc until i've got the whatever-it-is-I'm-playing with working (Makes mental note to self about next marriage...).
Drag the html file back to someplace on your toolbar, make a mental note of where it is, and use it from there for the next half-dozen searches today. On another day re-organize/rename toolbars.
I DID'NT close and reopen FF and I haven't found where my "Search" folder went, but I did find it in "Recently bookmarked" so it's there. It works when I use it so I'm happy.
I generally close/reopen, or even re-boot to prove to myself that whatever-it-is is well and truly installed, that's why I figured to close/reopen FF.
I'm glad that it all works for you now.
What do you mean about "select text" it should search...not sure what this means, but it obviously is significant if it's better than cabbage rolls!!!!
Andy pointed out the super-fast way of implementing a search.
Select some text in your browser pane, a half-dozen words or so.
Then click on Andy's button.
The button-script should spring into life, obtain the search text from your previous selection, and drop it right into the search box.
I am having a lot of fun with this, reminds me of the old parlor game "Bishop & Actress", but it seems not to work with text selected in a text box, like this text as I type.
If I choose now Preview and select some text from the preview pane (as distinct from the edit pane), I get an instant search.
He who plants a seed, plants life.

User avatar
Hey Jude
5StarLounger
Posts: 1015
Joined: 24 Jan 2010, 15:45
Location: Ohio, U.S.A.

Re: Add-on to exclude domains from right-click?

Post by Hey Jude »

I am still reading the latest from Andy to make sure. I still can't find that Search folder I made in Bookmarks...but I have My Google on the toolbar so won't worry about that. Thanks. It works!!! I just don't explain it very well. Then I saw that some of my personal info was showing, so just spent time editing that...THANKS!
♫...Take a sad song and make it better . . .♫ Image

User avatar
Hey Jude
5StarLounger
Posts: 1015
Joined: 24 Jan 2010, 15:45
Location: Ohio, U.S.A.

Re: Add-on to exclude domains from right-click?

Post by Hey Jude »

agibsonsw wrote:Copy the code into Notepad and save it as something.html.
In your browser choose File, Open (or equivalent) and open this file.
Drag the 'My Google' link from the page up onto your Bookmarks toolbar.
If you select text and then press the bookmark it should search for that text (without experts exchange).
If you don't select any text firstly, when you click 'My Google' you can enter text at that time.

Andy.
Thanks, as this makes it a perfect transition! It works!!!
♫...Take a sad song and make it better . . .♫ Image

User avatar
Hey Jude
5StarLounger
Posts: 1015
Joined: 24 Jan 2010, 15:45
Location: Ohio, U.S.A.

Re: Add-on to exclude domains from right-click?

Post by Hey Jude »

ChrisGreaves wrote: I'm glad that it all works for you now.

I am having a lot of fun with this, reminds me of the old parlor game "Bishop & Actress", but it seems not to work with text selected in a text box, like this text as I type.
If I choose now Preview and select some text from the preview pane (as distinct from the edit pane), I get an instant search.
Thank you Chris for your screenshots! They let me know I was on the right track!!


It is very cool, and I would never have had a clue about how to exclude anything--can somebody tell me what we are excluding means? What is site experts exchange? (this is all new so thank you for bearing with me)
♫...Take a sad song and make it better . . .♫ Image

User avatar
HansV
Administrator
Posts: 78620
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Add-on to exclude domains from right-click?

Post by HansV »

Excluding means that the search won't return any results from the specified site.

Experts Exchange is a discussion forum that tries to force people to register by hiding the replies from non-registered visitors. One can usually view replies in a direct link from Google by scrolling down past all the annoying messages, but crosslinks won't work. So a search result from Experts Exchange is not terribly useful if you're not registered there.

You can replace experts-exchange.com with any URL of a site that you don't want to see in your search results.
Best wishes,
Hans