Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function check_active_watching() {
- if (!obj.channelData.activeWatching) return;
- if (obj.activeWatching.style.display == 'inherit') return;
- obj.activeWatching.onclick = function() {
- let videoId = null,
- channelId = null;
- Array.from(document.getElementsByTagName('meta'))
- .forEach((el) => {
- if (el.getAttribute("itemprop") == "channelId") channelId = el.getAttribute("content");
- if (el.getAttribute("itemprop") == "videoId") videoId = el.getAttribute("content");
- });
- let subscription = (!(document.getElementById("notification-preference-button") ? .hasAttribute("hidden") ? ? true));
- let YouTubeName = document.getElementById("account-name") ? .innerHTML;
- let YouTubeId = undefined;
- if (document.getElementById("endpoint") ? .href) YouTubeId = document.getElementById("endpoint")
- .href.substr(document.getElementById("endpoint")
- .href.lastIndexOf("/") + 1);
- chrome.runtime.sendMessage({
- "type": "sendRequest",
- "endpoint": "collect_activity_points",
- "data": {
- subscription,
- YouTubeId,
- YouTubeName,
- videoId,
- channelId
- }
- });
Add Comment
Please, Sign In to add comment