Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- function triggerPopupClick() {
- const body = document.body;
- // Check if it's a single post page and the user is not logged in
- const isSinglePost = body.classList.contains('single') && body.classList.contains('single-post');
- const isLoggedIn = body.classList.contains('logged-in');
- if (isSinglePost && !isLoggedIn) {
- const popupLink = document.querySelectorAll('.jeg_popuplink')[0]; // Get the first matching element
- if (popupLink) {
- // Wait 3 minutes before triggering the click event
- setTimeout(() => {
- popupLink.click();
- }, 180000); // 180,000 ms = 3 minutes
- }
- }
- }
- // Run the function when DOM is ready
- if (document.readyState === 'loading') {
- document.addEventListener('DOMContentLoaded', triggerPopupClick);
- } else {
- triggerPopupClick();
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment