Basically my issue is I have a web browser (Chrome) running Qminder monitor displaying a queue but I want to show other stuff on the display at the same time.
The idea is that when someone is called, Qminder refreshes the browser window to show the update.
Is there a way to write a script that can monitor 24/7 for this browser refresh and switch the browser window back to the foreground?
I will already be making a script that will switch between the digital signage and the Qminder queue on regular intervals, but figuring out this key part of having the screen show the person being called is the most important part.
In the browser, we don't actually reload the page, we also listen to WebSocket events and add people into the UI dynamically.
You can write a script directly against the Qminder API, which will send you WebSocket events when someone is called. Alternatively, you can receive webhooks when you have a public-facing web server.
From an user experience perspective, it would be better to show the queue at all times. This shows your visitors where they are in the queue at a glance. For additional signage, we suggest you add another screen. :)
You should check out the Qminder API doc. You'll find useful information under the Events and Webhooks section. (Note, that the Events section is geared towards using the Qminder Javascript library)
As for showing and hiding applications: Hide Application. You can integrate it into a non-AppleScript solution via the osascript(1) program.
Related
I would like to know if it possible to run a JavaScript script continuously in the background of a CefSharp application, having it start upon the application first opening and run until it is closed.
Specifically, I am utilising a JavaScript-based eye tracking library. Upon the application opening, the user needs to calibrate the eye tracking. Once calibrated, this script needs to run in the background sending tracking information to other pieces of JavaScript.
Currently, all JavaScript is loaded and executed on the main frame. So, when the user navigates to new pages using the browser, execution ends and all the JS is re-loaded and re-executed upon the frame loading again. This makes it so that the user is prompted to re-calibrate the eye tracking on each new page load, whenever I need it to be performed only once.
The JavaScript files that are re-loaded need to be re-loaded, as they interact directly with the DOM and so need to access the information of newly loaded pages.
It'd be preferable for these re-loaded JavaScript files to be able to interact directly with the continuously running background code, but it is also possible to establish communication through a WebSocket.
Currently, I am not sure if this is even possible and if it is I do not know how to go about it.
I attempted to spawn a new separate frame that is never re-loaded and running the background JavaScript there - but I did not get very far. The application I am building on does not currently support multiple tabs (there seems to be no UI available for it, etc), hence why I found it difficult to spawn a new frame that the user can interact with briefly.
Apologies for the lack of code snippets - many thanks in advance.
So, I am making a Chrome extension that connects to an external server and allows you to chat with other users of the extension. However, the way my extension is set up right now is with a start page (the initial popup), and then a button that takes you to the chatting page.
I want to figure out a way that allows the extension to stay on the chatting page after the user passed through the start page already. Moreover, I want the chat's messages to be saved as well.
I know I can do this by using Chrome.pageAction.setPopup(). However, I don't if this is the way to go about. As for the messages, I am not sure where to start, do I store them in Chrome localStorage? what are the ways I can go about doing this?
I apologize if this is a trivial question, I am new to all this.
So my intend is the following: I want some kind of a server which allows me to have a function running on it which executes specific tasks on webpages. For example, a function (once executed) press a specific button on a specific website.
It's similar to web scraping but my main purpose is not to get data (like crawlers would do) but 'manipulating' a website. A simple example: The function on the server is triggered so it accesses the given website and presses a specific button by looking for its HTML-ID.
Also, there are some tutorials on how to execute this with a python script on your PC. A browser window then pops up and the script does what its told to do.
But how can I make this on a server where I can't/don't have a browser and where many requests from different PCs go in(which would mean that thousands of browser-tabs would open up which is not an option). Any idea how I can make this? Haven't found anything similar yet. Also are there any services for it?
I have an application that on load makes certain requests to backend to fetch data.
On the other hand, I have a web extension that basically modifies the behaviour of the browser's new tab so that when a user clicks new tab my application opens up. It's a productivity tool and users want this. The web extension is mostly an iframe that opens the application inside.
The problem I have is that every time a user clicks new tab, since the app starts loading in the new tab, a request to fetch the data from backend is made independently of if the user really wants to browse through the application or just navigate anywhere else with the new tab. In other words, 95% of the time the users just click new tab to browse and not to see my app. Obviously, this adds a lot of useless load to my server that I want to control.
What I do now as a temporary solution is to store the data in the localStorage, so that when a user clicks new tab, the data is loaded from the localStorage and can immediately be browsed, while I delay the fetches from backend to 12s. 12s because I figure it's enough time to click new tab, make a google query and navigate away. This reduces the load a lot, but obviously, delays the refetch of data for everyone for 12s.
Since the app can be used from multiple devices, delaying the synch for 12s is quite annoying.
Can you think of a better solution? (Obviously, I have no way to know if the users click newtab to see the app or to browse away, actually, not even they know!! so it's a tough one.)
Of course I already added a button to allow users to manually refetch on demand, but it's not a good solution UX wise.
Another way to minimize the load would be to just add the delay of the fetch to those requests coming from the web extension. But since the web extension is just an html that loads an iframe with the website, which ultimately makes the request, I'm not sure if there's a way to know if the request comes from the web extension at all. Is there?
Thanks!
I'm building a web-app that uses the device's camera and location services. The browser (I'm sticking to Chrome for now) asks the user for permission to do so on the page where the service is used.
I want the interface to be able to ask for permission at an early stage in the workflow so the pop-up dialogs don't come up during the use of the app. I know they would go away after the first visit to a page, but I want to avoid it the first time too.
Javascript is pretty much the only tool I know how to use, and I know each page has a separate Javascript execution context, so I can't get references to the objects on one page and hand them over to another.
So is there a way that will work? Maybe I need to learn some other technology?
If you need to do it in the browser, then I would suggest creating a sort of initialization page before going to the actual app page.
In the ini page you can call all permissions and download+cache all needed app scripts and also validate which permissions were accepted and not. Kinda something like when using GMail you go through their ini page first before getting to the actual GMail ui.
Once the ini page has completely loaded simply redirect to the actual app.
If you want to do it outside the browser and still use the same web technologies, take a look at Electron or NW.js.
Both tools above lets you build cross platform desktop apps with web technologies. Things like asking for camera and geolocation can be done without user permission (as I recall. not sure)