Code Monkey home page Code Monkey logo

happy-ferret / searchlinkfix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from palant/searchlinkfix

0.0 2.0 0.0 115 KB

Firefox extension that prevents Google and Yandex search pages from modifying search result links when you click them. This is useful when copying links but it also helps privacy by preventing the search engines from recording your clicks.

Home Page: https://palant.de/2011/11/28/google-yandex-search-link-fix

License: Mozilla Public License 2.0

JavaScript 39.46% Python 60.54%

searchlinkfix's Introduction

Google search link fix

Google search link fix is a Firefox, Chrome and Opera extension that prevents Google and Yandex search pages from modifying search result links when you click them. This is useful when copying links but it also helps privacy by preventing the search engines from recording your clicks. Detailed description

Installing build prerequisites

In order to build Google search link fix you will need to install Node.js first (Node 6 or higher is required). You will also need Gulp, run the following command to install it (administrator privileges required):

npm install --global gulp-cli

Additional dependencies are installed using the following command in the extension directory:

npm install

How to build

If all the dependencies are installed, creating a Firefox build is simply a matter of running Gulp:

gulp xpi

This will produce a file named like searchlinkfix-n.n.n.xpi. Creating a build for Chrome and Opera is similar but requires a private key that the build should be signed with:

gulp crx --private-key=key.pem

This will create a signed Chrome packaged named like searchlinkfix-n.n.n.crx. If you omit the private key parameter you will get an unsigned ZIP package instead.

How to test

In order to test your changes you can load the repository to your browser as an unpacked extension directly. Then you will only have to reload in order for the changes to apply.

Integration tests

Running the integration tests requires Python 2.7 and Marionette Python Client to be installed. You can run the integration tests with the following command:

gulp test --firefox-path=/usr/bin/firefox

You should change /usr/bin/firefox into the actual Firefox path on your system. This will instrument Firefox to test Google search link fix on various websites, all Python files from the tests directory will be executed. For these files the run() function will be executed with the Marionette instance as the only parameter. In addition to the official API, the following methods and properties are available:

  • driver.wait_for_load() will wait until the current page is fully loaded (note that Marionette.navigate() will merely wait until the DOMContentLoaded event).
  • driver.wait_until(method) will wait until the method returns True or time out after 10 seconds.
  • driver.accept_alert() accepts an alert box displayed by the webpage.
  • driver.restore_url() is to be called in the with statement and will navigate to previous URL once the with statement is exited.
  • driver.get_urls() will return the list of URLs the browser navigated to (including redirects) since the previous call.
  • driver.close_windows(keep) closes all windows but the one indicated as parameter.
  • driver.close_background_tabs() closes all but the currently selected tab in the current browser window.
  • driver.keys contains the key constants from marionette_driver.keys.
  • driver.expected contains the built-it wait conditions.

The HTMLElement API has been extended as well:

  • element.click() emulates a left mouse button click on the element.
  • element.middle_click() emulates a middle mouse button click on the element.
  • element.context_click() emulates a right mouse button click on the element.

Note that Marionette lacks a way to track navigated URLs which is why the testhelper extension is added to the Firefox profile in addition to Google search link fix. This extension is required for driver.get_urls() functionality.

searchlinkfix's People

Contributors

iiigerardoiii avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.