1const startUrl = "https://linkedin.com/feed";
2const accountUrl = "https://www.linkedin.com/company/{{username}}";
3
4//Click Sign-in by Google button to trigger google init script and prepare it for user clicking
5function clickGoogleAuthButtonIfPresent() {
6 const googleAuthButton = document.querySelector(
7 '[data-testid*="google_placeholder_button"]',
8 );
9 if (googleAuthButton !== null) {
10 googleAuthButton.click();
11 }
12}
13
14window.onload = function () {
15 setTimeout(clickGoogleAuthButtonIfPresent, 100);
16
17 console.log(
18 "JavaScriptNavigator: selecting action for " + window.location.href,
19 );
20 switch (window.location.href) {
21 case startUrl:
22 setInterval(() => {
23 if (window.location.href === startUrl) {
24 window.location.href = accountUrl;
25 }
26 }, 1000);
27 break;
28 default:
29 break;
30 }
31};
32