GPRO: Hide driver face

Remove the driver profile image on the driver profile pages.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         GPRO: Hide driver face
// @namespace    taviandir.gpro.driverface
// @version      0.0.3
// @description  Remove the driver profile image on the driver profile pages.
// @author       Taviandir
// @match        https://gpro.net/*
// @match        https://app.gpro.net/*
// @icon         https://www.google.com/s2/favicons?domain=tampermonkey.net
// @license      MIT
// @grant        none
// ==/UserScript==

// Run on page load
(function(){
	// check the URL of the current page to see if we are on a GPRO site
	var host = document.location.host;
	
	// on the old version of the app?
	if (host === "gpro.net") {
		// try and find the driver profile image element
		var el = document.querySelector("table#tableone tbody tr td a div img");
		// if found, then remove it
		if (el) {
			el.remove();
		}
	}
	// on the new version of the app?
	else if (host === "app.gpro.net") {
		// NOTE : we have to check every 0.1 seconds because during the 
		// new version of GPRO is a Single Page Application and thus,
		// the content won't be available directly on load.
		var intervalId = setInterval(() => {
			// try and find the driver profile image element (office page)
			var el = document.querySelector(".faceTd #driverFace img");
			
			if (!el) {
				// try and find the driver profile image element (driver profile page)
				el = document.querySelector(".driverProfileHighRes #driverFace img");
			}
			
			// if found, then remove it
			if (el) {
				el.remove();
				clearInterval(intervalId);
			}
		}, 100);		
	}
})();