Skip to content

Instantly share code, notes, and snippets.

@bogdan-nourescu
Last active June 16, 2017 13:22
Show Gist options
  • Save bogdan-nourescu/d0ae3b64a7a6f33928f3f3e74960ef24 to your computer and use it in GitHub Desktop.
Save bogdan-nourescu/d0ae3b64a7a6f33928f3f3e74960ef24 to your computer and use it in GitHub Desktop.
var newPlace = document.querySelector(".p6n-product-logo");
newPlace.innerHTML="";
var interval = setInterval(function(){
//we have setInterval here because they are lazy loading the pins
var pins=document.querySelectorAll("pan-console-nav-section-item.p6n-console-nav-pin-container");
if (pins.length > 0) {
clearInterval(interval);
} else {
return;
}
for(var i=0;i<pins.length;i++){
var pin=document.querySelectorAll("pan-console-nav-section-item.p6n-console-nav-pin-container")[i];
pin.querySelector(".p6n-console-nav-item-text").remove();
pin.querySelector("ng-transclude").remove();
pin.querySelector("pan-logo.p6n-console-nav-item-icon").style.width="48px"
pin.querySelector(".p6n-console-nav-item-link").style.minWidth="24px";
newPlace.appendChild(pin);
}
},1000);
{
"manifest_version": 2,
"name": "Pins GCP",
"description": "Moves the pins in GCP",
"version": "0.1",
"permissions": [
"tabs",
"https://console.cloud.google.com/*"
],
"content_scripts": [
{
"matches": ["https://console.cloud.google.com/*"],
"js": ["inject_script.js"],
"run_at": "document_idle"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment