Skip to content

Instantly share code, notes, and snippets.

@serihiro
Last active July 1, 2017 14:25
Show Gist options
  • Select an option

  • Save serihiro/4be090bf4e3c5be11441cabdc63f3be1 to your computer and use it in GitHub Desktop.

Select an option

Save serihiro/4be090bf4e3c5be11441cabdc63f3be1 to your computer and use it in GitHub Desktop.
Delete Niconico news chrome extension
{
"name": "DeleteNiconicoNewsBar",
"version": "0.0.1",
"manifest_version": 2,
"description": "The exntension which deletes a niconicoo news bar.",
"content_scripts": [
{
"matches": ["http://www.nicovideo.jp/watch/*"],
"js": ["script.js"],
"run_at": "document_idle"
}
]
}
obstructive_element_selectors = [
'.MarqueeContainer',
'.BottomContainer',
'.BottomContainer-side',
'.MiniBannerAdContainer',
'.FooterContainer',
'.CommentPanelContainer',
'.UadButton ',
'.UadButtonBalloon',
'.HeaderContainer-searchBox'
]
obstructive_element_selectors.forEach(
(selector) => {
element = document.querySelector(selector)
if(element)
element.remove()
}
)
document.querySelectorAll('.VideoMenuShareButton').forEach((e) => {e.remove()})
container = document.querySelector('.MainContainer-commentPanel')
container.style.position = 'static'
tags = document.querySelector('.TagContainer-area')
tags.style.display = 'block'
tag_container = document.querySelector('.TagContainer')
tag_container.style.width = '50%'
setTimeout(
() => {
ad = document.querySelector('.MiniBannerAdContainer')
if(ad)
ad.remove()
ad_baloon = document.querySelector('.UadButtonBalloon')
if(ad_baloon)
ad_baloon.remove()
}, 1000
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment