Skip to content

Instantly share code, notes, and snippets.

@t-kashima
Last active December 27, 2015 06:19
Show Gist options
  • Save t-kashima/7281159 to your computer and use it in GitHub Desktop.
Save t-kashima/7281159 to your computer and use it in GitHub Desktop.
Yammerの表示から指定した要素を削除します。 content_script.jsのHIDE_ID_LISTで要素を指定して下さい。
.display_none {
display: none !important;
}
const HIDE_ID_LIST = [
'[href="#import-address-book-lightbox"]',
'[href="#reinvite-all-lightbox"]'
];
var hideElementById = function(id) {
var elements = document.querySelectorAll(id);
for (var i = 0; i < elements.length; i++) {
var e = elements[i];
if (e.classList.contains('display_none') === false) {
e.classList.add('display_none');
}
}
};
(function() {
// console.log('This site is a Yammer');
for (var i = 0; i < HIDE_ID_LIST.length; i++) {
var id = HIDE_ID_LIST[i];
// console.log('remove id: ' + id);
this.hideElementById(id);
}
})();
{
"name": "Hiding in Yammer",
"version": "1.0.0",
"manifest_version": 2,
"description": "This extention hide a part in Yammer",
"content_scripts": [
{
"matches": ["https://www.yammer.com/*"],
"css": ["content_script.css"],
"js": ["content_script.js"]
}
],
"permissions": ["background"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment