Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New script: tampermonkey/set-new-tab/
- Loading branch information
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0 - Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2014 LouCypher. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// ==UserScript== | ||
// @id chrome-newtab@loucypher | ||
// @name Google Chrome - Set New Tab | ||
// @namespace https://github.com/LouCypher/userscripts | ||
// @description Set a specified URL as new tab page on Google Chrome. | ||
// @version 1.0 | ||
// @author LouCypher | ||
// @license MIT License | ||
// @contributionURL http://loucypher.github.io/userscripts/donate.html?Google+Chrome+-+Set+New+Tab | ||
// @homepageURL https://greasyfork.org/scripts/217 | ||
// @supportURL https://greasyfork.org/scripts/217/feedback | ||
// @downloadURL https://greasyfork.org/scripts/217/code.user.js | ||
// @updateURL https://greasyfork.org/scripts/217/code.user.js | ||
// @resource CHANGELOG https://raw.github.com/LouCypher/userscripts/master/tampermonkey/set-new-tab/CHANGELOG.txt | ||
// @resource LICENSE https://raw.github.com/LouCypher/userscripts/master/tampermonkey/set-new-tab/LICENSE.txt | ||
// @match http://*/* | ||
// @match https://*/* | ||
// @run-at document-start | ||
// @grant GM_getValue | ||
// @grant GM_setValue | ||
// @grant GM_registerMenuCommand | ||
// ==/UserScript== | ||
|
||
if (/^https?:\/\/www.google.[a-z.]+\/\_\/chrome\/newtab.*/.test(location.href)) { | ||
document.documentElement.innerHTML = "<head></head><body></body>"; | ||
location.replace(GM_getValue("newTabURL", "about:blank")); | ||
} | ||
|
||
GM_registerMenuCommand("Set new tab page", function() { | ||
var setCurrentPage = confirm("Use current page as new tab? Press 'Cancel' to enter URL"); | ||
if (setCurrentPage) | ||
GM_setValue("newTabURL", location.href); | ||
else { | ||
var url = GM_getValue("newTabURL", "about:blank"); | ||
var newTabURL = prompt("Enter URL as new tab.\nEnter 'about:blank' to use blank page", url); | ||
if (newTabURL) | ||
GM_setValue("newTabURL", newTabURL); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// ==UserScript== | ||
// @id chrome-newtab@loucypher | ||
// @name Google Chrome - Set New Tab | ||
// @namespace https://github.com/LouCypher/userscripts | ||
// @description Set a specified URL as new tab page on Google Chrome. | ||
// @version 1.0 | ||
// @author LouCypher | ||
// @license MIT License | ||
// @contributionURL http://loucypher.github.io/userscripts/donate.html?Google+Chrome+-+Set+New+Tab | ||
// @homepageURL https://github.com/LouCypher/userscripts | ||
// @supportURL https://github.com/LouCypher/userscripts/issues | ||
// @downloadURL https://raw.github.com/LouCypher/userscripts/master/tampermonkey/set-new-tab/userscript.tamper.js | ||
// @updateURL https://raw.github.com/LouCypher/userscripts/master/tampermonkey/set-new-tab/userscript.tamper.js | ||
// @resource CHANGELOG https://raw.github.com/LouCypher/userscripts/master/tampermonkey/set-new-tab/CHANGELOG.txt | ||
// @resource LICENSE https://raw.github.com/LouCypher/userscripts/master/tampermonkey/set-new-tab/LICENSE.txt | ||
// @match http://*/* | ||
// @match https://*/* | ||
// @run-at document-start | ||
// @grant GM_getValue | ||
// @grant GM_setValue | ||
// @grant GM_registerMenuCommand | ||
// ==/UserScript== | ||
|
||
if (/^https?:\/\/www.google.[a-z.]+\/\_\/chrome\/newtab.*/.test(location.href)) { | ||
document.documentElement.innerHTML = "<head></head><body></body>"; | ||
location.replace(GM_getValue("newTabURL", "about:blank")); | ||
} | ||
|
||
GM_registerMenuCommand("Set new tab page", function() { | ||
var setCurrentPage = confirm("Use current page as new tab? Press 'Cancel' to enter URL"); | ||
if (setCurrentPage) | ||
GM_setValue("newTabURL", location.href); | ||
else { | ||
var url = GM_getValue("newTabURL", "about:blank"); | ||
var newTabURL = prompt("Enter URL as new tab.\nEnter 'about:blank' to use blank page", url); | ||
if (newTabURL) | ||
GM_setValue("newTabURL", newTabURL); | ||
} | ||
}); |