How to make Webpage run in background? - javascript

Sorry if I am not posting in the correct way or in the correct spot, but I am in dire need of help and you are kinda my last resort.
My problem is:
We have Monitor A and Monitor B.
On monitor B I need to have a webpage open at all times that has a list of things that refreshes automatically every 30s.
Problem is, when I click anywhere else on Monitor A, that automatic refresh stops and it does not start again until I click anywhere on that webpage on Monitor B.
Is there a way to make that list think that the webpage is not in the background so it won't stop the refresh?
I can not use an autorefresh for the whole webpage because if I do that, it will also erase all the filters from my list.
I have tried using it always on top, but it does not help :(
If someone is able to help me with this, I would gladly appreciate it šŸ™
You are my last resort other than connecting a laptop to it šŸ˜”

Related

How does an auto refresh page extension works and how to recreate one with code?

I'm looking for a way to recreate the functionality of a refreshing page extension on a browser (e.g. Auto refresh plus in Chrome) by using javascript. The problem is that I have no ideia how to achieve that.
I must find a way to refresh the page every second or so, click on a link that appears on the page from time to time, add a sound effect for when it appears and send an e-mail notification every time it appears.
I'm trying to use a simple javascript snippet to run in the console in order to refresh the page:
win1 = window.open("https://www.myUrl.com/");
timer1 = setInterval(function(){win1.location.href="https://www.myUrl.com/"}, 1500);
However, this implies running code from tab A on tab B which I found very challenging.
The code can't run on tab A alone because at the time it refreshes the page, it gets erased from the console.
I know it would have been so much easier to use an extension, but the platform I work for does not allowed any extensions.
I have basic HTML and javascript knowledge, but I find this would be a good project to learn more.
Also, if the solution involves other languages, I just need a direction to know where to look for and start this project.

How do I open a link to a website on a new window in a browser and block the current website until the user finish or close the new one?

Currently I'm working with Mercado Pago API, but the thing is that I want when the user clicks the pay button, I want to open a new window in the browser (chrome, firefox, etc.) in the middle of the screen where is going to fill his credit card number and all that stuff meanwhile i want that the background site (I mean the main site where the user clicked on pay) to be blocked, like with darker colors, and not be able to do anything in that site until the user close the new window or he finish with the payment. I've been looking on the internet but I haven't found anything related to the blocked site. Maybe you could help me or have any idea to make that. thanks in advance.
I can't make comments, so sorry in advance for this being an "answer". But are you not able to store information about what the user has selected and then use the current page to process the payment, then bring back or send off what they wanted? perhaps using AJAX to run a PHP page that stores something. Just a suggestion but not entirely an answer, because AFAIK you can't "block" tabs as that could be very dangerous and could be used for the wrong reasons.
The task you want to do requires both back-end programming (php/server-side) and a bit of front-end jquery(js) + ajax.
For front-end something like this could be your start.
Bootstrap Static Modal Example.
And you would need to put your form there, submit it via ajax, and on success close the modal.
I hope this could help you a bit, and get you started in the right direction.
Note: This is not particularly safe. (It's not hard to hide the modal and fiddle around the page in the background.

html or javascript code to keep refreshing even after the website goes down

I have a issue where we want a webpage to keep reloading at an interval even if the server hosting the code goes down. This is so that if the server goes down, it will keep trying to refresh the page so that when the server does come back up, it will recover. There seems to be a ton of ways to refresh/reload a page based on interval or demand, but I can't find a way to have the page recover automatically after the server eventually comes back online.
Can anyone point me in the right direction here?
Thanks,
you can try using iframe to contain the entire website. the host site should not reload

Feedback survey modal on window close event after 10 exits, irrespective of same or different user

I am a newbie to it, so please bear with me.
I am looking to set up a feedback survey in Survey Monkey but would like a pop up box (modal) to appear when users exit the website.
Ideal requirements:
Ideally Iā€™d like the pop up box to appear for approx. 1 in every 10 visits to the site. (either close or refresh window tab), using javascript / jquery.
Seeking for expert advice.
Many thanks
I think what you're looking for is a popup website collector. Either the Popup Invitation or Popup Survey type. Just choose the Website collector type when creating a new collector for a survey.
Looking at the help page and the options it doesn't seem to have the options to set how often the popup shows up. You may be able to modify the embed code to set when and how often it pops up but I'm unsure about that.
You can give it a go or contact SurveyMonkey support if you're having trouble.
just to give an update, we used the reference link: http://beeker.io/exit-intent-popup-script-tutorial
to implement as per our requirements, by setting cookies for each user instead of users count. Hope this will help to someone. Thanks

waitForKeyElements(); - Stop a script firing on a popup in Chrome Extension?

This question is a follow-on to another question which needed asking and warranted a new post, so excuse me if I refer to things which may not be clear without reading the other question.
When using the utility waitForKeyElements() I'm facing an issue in which a div is included inside a small popup contained within the same URL. My extension is currently running on the Twitter site, and my intention is that a div contained on the profile pages (e.g. http://twitter.com/todayshow) gets moved above another div on the page. I'm doing this via waitForKeyElements() because of some loading issues which are resolved by using this utility.
However, on a profile page you can click a link to another users name which pops up a small window (inside the same window/tab, on the same URL) showing some info about them and a few previous tweets. The issue here is that the same div appears on this popup and is then moved to the main page behind the popup window, where it shouldn't be. On a profile page, this can be stopped by plugging in the false parameter to waitForKeyElements(), however on a non-profile page it is still possible to activate this popup which is then moving onto the main page, as the div I wish to move it above on a profile page still exists here, causing clear issues.
I'm wondering if there's a way around this, as bugs in Chrome have stopped me from excluding these pages. So far (just brainstorming) I'm thinking:
on a page where the div doesn't exist to begin with, create an empty one meaning false will handle the issue.
somehow stop the script from firing on a given URL, although due to the way Twitter works this would have to monitor OnClick() and the page URL (I think) which I'm unsure how to do.
stop running when the popup appears, but I have almost no idea where to start with that.
Any help is appreciated. Any necessary code related to this question can be found in the first two links, and the issue I'm facing can be seen by a quick visit to Twitter.
EDIT: When plugging in the false param it works when going directly to profiles via the URL bar, if you're on a profile and use a link to get to a profile, the script isn't inserted and my extension fails. So this would need resolving too, or an alternative method altogether.
I had a brainwave that I could use insertAfter() to insert the <div> I was originally moving in front of, after the <div> I was originally moving. This <div> is not present on the popup, which means that nothing is moved onto the back page when it shouldn't be.
In regards to the previous question, my code is now simply:
waitForKeyElements (
"jQuery selector for div(s) you want to move", // Opposite to what it was.
moveSelectDivs
);
function moveSelectDivs (jNode) {
jNode.insertAfter ("APPROPRIATE JQUERY SELECTOR"); // Again, the opposite.
}
This solves the issue I was having and my extension is now working just fine, however I will leave this question posted in case anybody comes back to it in future.

Categories

Resources