Skip to content

Instantly share code, notes, and snippets.

@ministrycork
Last active March 15, 2018 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ministrycork/bab2c26b2015e8e1367bd3a20858b9dd to your computer and use it in GitHub Desktop.
Save ministrycork/bab2c26b2015e8e1367bd3a20858b9dd to your computer and use it in GitHub Desktop.
Solarwinds Chrome Extension
{
"manifest_version": 2,
"name": "SolarWinds Salesforce & Tableau 360 search",
"description": "Searches Salesforce and Tableau 360 view for the SWID provided",
"version": "2017.1.5",
"author": "Tony Johnson",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"tabs"
]
}
<!doctype html>
<!--
This page is shown when the extension button is clicked, because the
"browser_action" field in manifest.json contains the "default_popup" key with
value "popup.html".
-->
<html>
<head>
<title>SolarWinds Salesforce & Tableau 360 view SWID search</title>
<style type="text/css">
body {
margin: 10px;
white-space: nowrap;
}
h1 {
font-size: 15px;
}
#container {
align-items: center;
display: flex;
justify-content: space-between;
}
</style>
<!--
- JavaScript and HTML must be in separate files: see our Content Security
- Policy documentation[1] for details and explanation.
-
- [1]: https://developer.chrome.com/extensions/contentSecurityPolicy
-->
<script src="popup.js"></script>
</head>
<body>
<h1>Salesforce & Tableau 360 view SWID search</h1>
<hr>
<div id="container">
<b>Enter SW#</b>
<hr>
<input id="SWID">
<button id="GoBtn">Go</button>
</div>
</body>
<script src="https://www.gstatic.com/firebasejs/4.11.0/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyD-ekAP_BkGAfd6ugETHkcOk77QxDJevh8",
authDomain: "chromeextension-99b91.firebaseapp.com",
databaseURL: "https://chromeextension-99b91.firebaseio.com",
projectId: "chromeextension-99b91",
storageBucket: "",
messagingSenderId: "653036394075"
};
firebase.initializeApp(config);
</script>
</html>
document.addEventListener('DOMContentLoaded', function() {
var GoBtn = document.getElementById('GoBtn');
// onClick's logic below:
GoBtn.addEventListener('click', function() {
var SWID = document.getElementById('SWID').value;
chrome.tabs.create({'url': 'https://tableau/#/views/Customer360View/CustomerOverview?swid_filter=SW'+SWID });
chrome.tabs.create({'url': 'https://solarwindscore.my.salesforce.com/_ui/search/ui/UnifiedSearchResults?searchType=2&sen=001&sen=006&sen=00O&str=SW'+SWID });
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment