Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function youtube() {
let window = activeWin.sync();
try {
let appExtension = isWin() ? ".exe" : ".app";
let processName = window.owner.name;
let windowTitle = window.title;
if (processName.toLowerCase() == `chrome${appExtension}`) {
if (windowTitle.includes('YouTube')) {
let title = windowTitle.split('YouTube');
if (title[0] !== video) {
video = title[0].slice(0,-2);
var splitEachChar = video.split('');
var count = getOccurrence(splitEachChar,'-'); // prevent it from splittin to much, certain youtubers loves to put "-" in title
if(count <= 1){
artist = video.split("-")[0]; //for music channels get artist
video = video.split("-")[1]; //and song name
async function isActiveWindow(page, yes = true) {
const assert = yes ? equal : notEqual;
const window = await activeWin(), path = PuppeteerBrowser.executablePath();
if ( window.owner.path )
assert(path, window.owner.path);
else
assert(path.match( /([^/]+)(\.\w+)?$/ )[1], window.owner.name);
}
async function checkPhotoshop() {
let window = monitor.sync();
try {
let appExtension = isWin() ? ".exe" : ".app";
let processName = window.owner.name;
let windowTitle = window.title;
if (processName.toLowerCase() == `photoshop${appExtension}`) {
if (windowTitle.includes('.psd') || windowTitle.includes('% (RGB/')) {
let split = windowTitle.split('@');
if (split[0] !== currentFile) {
currentFile = split[0];
updateRP(`Editing ${currentFile}`);
}
} else {
if (currentFile !== "IDLE") {
constructor(time: bigint) {
this.time = Math.floor(new Date().getTime() / 1000);
const windowInfo = activeWin.sync();
this.idle = powerMonitor.getSystemIdleTime() > Settings.getIdleTime();
if (windowInfo !== undefined) {
this.process = new ProcessModel(windowInfo.owner.path, windowInfo.owner.name);
this.window = new WindowModel(windowInfo.title, this.process);
} else {
throw new Error("Could not get active window");
}
}