Last active
March 27, 2018 20:31
-
-
Save gofydo/3a170dd3b3b9fa74b6c60234f5ae59c4 to your computer and use it in GitHub Desktop.
A JS bookmark that prompts for a piece of swappable URL params, and navigates to it in a new tab.
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
javascript:(function() { | |
var url = "https://www.google.com/search?safe=active&biw=1302&bih=916&tbm=isch&source=lnt&tbs=isz:ex,iszw:128,iszh:128&q={q}"; | |
var prompt = 'Name the icon:'; | |
var input_text = ''; | |
function isValid() { | |
return q.length > 0; | |
} | |
function getQuery() { | |
return window.prompt(prompt, input_text); | |
}; | |
var q = getQuery(); | |
if (q == null){ | |
return; | |
} | |
while (!isValid(q)){ | |
var q = getQuery(); | |
} | |
window.open(url.replace('{q}', q)).focus(); | |
})() |
MILTON TPX Jenkins Build Params
javascript:(function() {
var url = "https://jenkins-ci.goscoutgo.com/job/milton-tpx-ci-github/{q}/parameters/";
var prompt = 'What Milton-TPX build are you looking for?';
var input_text = '';
function isValid(q){
return q !== '';
}
function getQuery() {
return window.prompt(prompt, input_text);
};
var q = getQuery();
if (q == null){
return;
}
while (!isValid(q)){
var q = getQuery();
}
window.open(url.replace('{q}', q)).focus();
})()
SCOUT-APP Jenkins Build Params
javascript:(function() {
var url = "https://jenkins-ci.goscoutgo.com/job/scout-app-ci-build-github/{q}/parameters/";
var prompt = 'What SCOUT-APP build are you looking for?';
var input_text = '';
function isValid(q){
return q !== '';
}
function getQuery() {
return window.prompt(prompt, input_text);
};
var q = getQuery();
if (q == null){
return;
}
while (!isValid(q)){
var q = getQuery();
}
window.open(url.replace('{q}', q)).focus();
})()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another example to search for a JIRA ticket.