Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Duck Duck Go search on new tab
- // @description In the search bar pressing CTRL + ENTER will search on a new tab
- // @include https://www.duckduckgo.com/*
- // @include https://duckduckgo.com/*
- // @include http://duckduckgo.com/*
- // ==/UserScript==
- (function () {
- var searchForm = document.getElementById("search_form");
- document.addEventListener('keydown', function (e) {
- if (e.keyCode == 17) {
- searchForm.target = "_blank";
- }
- }, false);
- document.addEventListener('keyup', function (e) {
- if (e.keyCode == 17 || e.keyCode == 13) {
- searchForm.target = "_self";
- }
- }, false);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement