-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8938361
commit 2348996
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* eslint-disable no-param-reassign */ | ||
import create from '@/content-scripts/web-integration'; | ||
|
||
function init(): void { | ||
// In case we are on an anime page. | ||
if (document.querySelector('body .adn-maincontent meta[itemprop="name"]')) { | ||
create({ | ||
selector: 'body .adn-maincontent meta[itemprop="name"]', | ||
getValue: (node: HTMLElement) => node.getAttribute('content'), | ||
getTitle: (node: HTMLElement) => node.getAttribute('content'), | ||
appendInPage(node: HTMLElement): void { | ||
node.style.marginBottom = '10px'; | ||
node.style.textAlign = 'left'; | ||
|
||
const target = document.querySelector('body .adn-maincontent .header h1'); | ||
if (target) target.prepend(node); | ||
|
||
const targetMobile = document.querySelector('body .adn-maincontent .mobile-h1'); | ||
if (targetMobile) targetMobile.prepend(node.cloneNode(true)); | ||
}, | ||
}); | ||
} | ||
|
||
// In case we are on an anime episode page. | ||
if (document.querySelector('body .adn-maincontent .adn-player-header h1 > a')) { | ||
create({ | ||
selector: 'body .adn-maincontent .adn-player-header h1 > a', | ||
appendInPage(node: HTMLElement): void { | ||
node.style.marginBottom = '10px'; | ||
node.style.textAlign = 'left'; | ||
|
||
const target = document.querySelector('body .adn-maincontent .adn-player-header h1'); | ||
if (target) target.prepend(node); | ||
}, | ||
}); | ||
} | ||
} | ||
|
||
init(); |
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
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
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