I wanted to know what would be the best route in mimicking the feature of snapchat of an application being aware of a user screenshotting the page?
By the question I assume you are facing the problem of detecting a screenshot. We can monitor the clipboard and detect the application running in foreground. In case of any snipping tool, the screenshot goes to the clipboard and we can paste it directly.
Related
I am trying to make a custom web browser inside an electron application. Using webview (because iframe is not loading some necessary web pages) I can load a web page.
Then trying to write something into the web pageĀ“s input by clicking on the react-simple-keyboard which causes blur event, so input loses focus.
I figured out, that this approach would not work directly, so via ipc communication I am trying to resend the key button value and then set it to the window with const {keyboard} = require("#nut-tree/nut-js"); keyboard.type(args.value);
In my input, above the webview tag, it works like a charm, but I am not able to type inside the webview.
Can anyone help me to solve this problem or does anyone know a perfect solution how to use other OSK in electron app or how to open native windows osk on input focus? Thank you in advance.
I'm not sure how you'd accomplish that with this library. But you can just use Window's default on-screen-keyboard to accomplish that. Here is a link to how enable it. windows support
You should also use a BrowserView instead of a Webview, as the Webview is not guaranteed to be present in future versions and it's API is unstable.
The BrowserView doesn't work like an HTML element though and you should read the docs here.
But anyways, just use the system's default and you should be fine.
Also, if you're interested, I'm developing a web browser with Electron (in fact, I'm currently writing this using that browser) and as far as I can say, it's written pretty simply and anyone should understand most of it, so take a look if you're in trouble. But I am no expert and you shouldn't rely on my code as a standard of any kind, really.
Well, I might have just found an answer for you.
Firstly, as I mentioned, you should use a BrowserView instead of webView for your external content, and this time it is a requirement for this method to work. I would create a BrowserWindow with the controls at the top, then place a BrowserView to act as a "browser" and create another BrowserView at the bottom and load in the keyboard html file. And then, when a key is pressed on the virtual keyboard, you should send an ipc message to the main script with the information of what key was pressed(it should be done via a preload script for the OSK BrowserView). In the main script, once you recieve the ipc message (via ipcMain.on()) you should then send an input event to the BrowserView containing your external content. That's done by calling contents.sendInputEvent(Event), so it has to be a main script. Here is a link to contents.sendInputEvent(Event), BrowserView (link) and preload script as well as ipc communication (link).
As for invoking the keyboard once you click on the input element, you could probably do it with a preload script for your "browser's" BrowserView, if you can find how you can check whether the focused element is an input element or something like that, and call an ipc message to then hide or show the keyboard. (Hiding and shwoing the keyboard could be done by calling BrowserWindow.addBrowserView(BrowserView) or BrowserWindow.removeBrowserView(BrowserView). But you would have to search the documentation yourself for those methods as I can't write anymore right now. Documentation could anwser any of your questions if you search for it there.
Edit: Thank you wOxxOm. It worked :)
chrome.tabs.move(XXX,{windowId:YYY, index:ZZZ})
Somehow I did not see the move option :(
I am writing simple Google Chrome web extension and I want to manipulate the tabs and windows. I actually want to be able to move a tab between the windows. The tab will have programatically spawned dynamic page, that I do not want to reload. The windowId is not listed in the modifiable properties chrome.tabs.
Am I missing something or it is currently not supported? What are the workarounds?
p.s. In extreme case also powershell or .Net might be acceptable (I have total control of the target PC). Currently spawning clearly distinguishable iframe over the web pages (background script injected and message listener) but the iframe gets reloaded, which I want to avoid.
p.p.s. Workaround might be to detect the currently active window and spawn new tab in the active window (if required), but this would require to save the page state, close the inactive tab and spown new one in the active window (this should be possible)
p.p.p.s. Main target is Google Chrome, but want it also for Microsoft Edge. Hopefully also for other browsers.
Edit: Thank you wOxxOm. It worked :)
chrome.tabs.move(XXX,{windowId:YYY, index:ZZZ})
Somehow I did not see the move option :(
In the new Microsoft Flight Simulator you can pop different cockpit displays out into their own external windows, like this:
However, none of the buttons needed to interact with the displays get "popped out" as well.
I'd like to build a web app that can embed (the continuously updating image of) one of these windows that I can surround with buttons, etc, for interaction to have, say, running on a tablet next to you.
My question is, is it possible with Node to embed the continuously updating image of a native Windows window within a webpage?
Stumbled upon the Screen Capture API. This is what I was looking for.
https://developer.mozilla.org/en-US/docs/Web/API/Screen_Capture_API
first post here so I hope I'm not breaking any rules.
So, the situation I'm faced with is a bit complicated. I'm basically trying to login into a hangouts call without having the ability to use the browser itself. I can only insert the URL. Why is that you may ask?
I'm trying to show a hangouts call on my twitch stream using a OBS plugin called CLR browser. This plugin only allows to rezise the window and add a URL from where it'll take information from. It's great for notifications but not so great for what I'm trying to do. But after investigating alot I came to the conclusion that I'm out of options.
I do know you can login to gmail by only using the url like here:
How do I login into Google Apps via a URL?
If, for example I have a hangouts link like this:
https://plus.google.com/hangouts/_/gruxore63cq34fwddtcwwe64raa
Can I add something at the end so it logs in automatically?
Thank you.
Hate to disappoint, but you cannot auto-login using a link. OBS does allow you to screen share a window, though, so you should be able to open your favorite web browser, enter the Hangout, then share the window.
Failing that, XSplit has very flexible screen/region-sharing abilities.
Here's a YouTube video demonstrating exactly how to do this in OBS, and the link is time-coded right to the good-stuff.
We have a asp.net web application which will be used in an intranet environment on IE 6. We want to change the default configuration of the browser so that it's always rendered without the Tool Bars, Menu Bars and Address Bar, just the browser window frame and the status bar should be present.
We were looking at the IEAK toolkit for IE6 but it doesn't seem to have the option of turning all this off though you can turn off certain menus and toolbar options.
Any ideas of how this can be done, is there a group policy setting or something that we can utilize here to get this done?
Thanks for your help.
You have to handle the showing of toolbars, address bar,... before the page is loaded, because it's built client side.
So to solve your problem, I think you should write the first page (Enter page for example) Then when use click on the Enter link you open another page using VBScript or Javascript to remove toolbars, address bar,...
Hope this helps ^^
Have you investigated Kiosk Mode?
Also, you're deploying IE6 at the wrong end of its lifecycle.
It also sounds like your requirement is for an app you're developing; mandating that the browser is configured this way for all sites might make the customers unhappy. If you want to know how to open a browser window without those things for your site, from your site, I'd suggest a repost to StackOverflow.