I am building a plugin using JavaScript,as part of this i have disabled all the keys but still unable to control the bellow keys , is there any way that i can block the fallowing?
New Window (Ctrl+N)
Restore Tab (Ctrl+Shift+T)
Select Next Tab (Ctrl+Tab, Ctrl+PageDown)
Select Previous Tab (Ctrl+Shift+Tab, Ctrl+PageUp)
Exit (Alt+F4, Cmd+Q)
(Alt+Tab)
i am trying with registry, is it possible to disable remote desktop when ever the plugin installed?
You could turn on kiosk mode for the window which makes it full screen and always on top so you can't go to another application.
You could also make the window transparent and position the login in the middle of the screen so it appears as if there is one window in the middle of the screen but you can't click on other areas of the screen.
To handle for Alt+F4 you can use the window.onbeforeunload event or call event.preventDefault() in the close event.
https://electron.atom.io/docs/api/browser-window/#event-close
Related
On click of an input field, a projected popup window opens (have used z-index).
Now when i press TAB, i want the focus to automatically move from background screen to the popped up window.
Is it possible to achieve this flow of TAB navigation through built in properties or styling ?
NOTE 1: I tried setting focus to the outer div of the popup programatically.
So that the focus is moved from background to popup.
But it fails in IE11 and IE10 because, the cursor remains in one element and the focus remains in another element when navigation passes through an empty field. I DONOT WANT HELP FROM COMMUNITY MEMBERS TO DEBUG THIS CODE.
NOTE 2: I won't be able to set the tabindex for the popup window elements statically. Because in that case, the TAB moves to those elements even when the popup window is not visible.
I've been trying to open a "popup" [1] without it taking the focus automatically.
I tried to blur it, from the opener or from the popup itself unsuccessfully.
I also looked for pop-under but didn't find anything relevant on Google about both topic.
I'm using Firefox. (Well… Palemoon 24.7.1 for x64 actually)
My goal is to be able to open a bunch of tabs (with middle click for instance) and having them closing on their own a bit later.
To do so in Firefox, and afaik, you MUST use a popup (right?). But everytime I open a new tab (with middle click) it focuses on it which is very annoying.
[1] Or anything else that could match my expectations.
EDIT: NOTE: This is for personnal use. :)
First the easy one: For mouse-middle-click: In Tools->Options on the "Tabs" tab, there is an option "When I open a link in a new tab, switch to it immediately". After un-checking this option, links followed by selecting "Open in new Tab", or mouse-middle-click will open in a new tab without being focused. On the same option tab, you will also want "Open new windows in a new tab instead" checked (first checkbox).
This will work for most normal links. Links which are actually JavaScript code snipits will not work in a new tab because they rely on the code existing in the current page.
A change that I find useful in Firefox is to have the cursor change depending on what type of link it is hovering over. This will allow you to visually distinguish, at a basic level, what will happen when the link is clicked without having to look at the destination address. I originally found this at askvg. It is an addition to the file <profile directory>/chrome/userContent.css (create the directory and file if they do not exist):
/* Change mouse cursor for hyperlinks that open in a new window or tab */
:link[target="_blank"], :visited[target="_blank"],
:link[target="_new"], :visited[target="_new"] {
cursor: crosshair;
}
/* Change mouse cursor for JavaScript links */
a[href^="javascript:"] {
cursor: move;
}
/* Cursor types
default - Normal select cursor
text - Text select cursor (I bar)
vertical-text - Vertical text select cursor
progress - Working in background cursor
wait - Busy cursor
help - Help cursor
crosshair - Precision select cursor
move - Move cursor
no-drop - Unavailable cursor
not-allowed - Unavailable cursor
e-resize - Horizontal resize cursor
n-resize - Vertical resize cursor
nw-resize - Diagonal resize 1 cursor
ne-resize - Diagonal resize 2 cursor
col-resize - Column resize cursor
row-resize - Row resize cursor
*/
Beyond that, it is unclear in what context you want to do this in, or at least to what extent you are willing to go to accomplish this. Your mentioning having windows/tabs open in the background and closing on their own implies that you do not actually need the user to view the window/tab. Is it that you just want a request to have been made of some URLs? Would using XMLHttpRequest be sufficient?
You want this for yourself, so if you go the route of a Firefox extension then it is quite easy to open tabs and windows and not have them be focused. It can be done with addTab().
It would be helpful for you to describe what it is that you are overall attempting to accomplish and the context in which you are doing so.
Additional information:
Based on the additional information which you have described what you need is to write a Firefox extension which can give you complete control of popups and tabs to have them work the way you desire. For what it sounds like you desire you should see (at least) the following Mozilla documentation:
Tabbed browser (Contains explicit examples of how to open a tab (w/o selecting it) and how to do so and also select it.)
BrowserApp
addTab
closeTab
tab
Copying an example on Tabbed browser:
// Add tab (without it becoming active)
gBrowser.addTab("http://www.google.com/");
// Add tab, then make active
gBrowser.selectedTab = gBrowser.addTab("http://www.google.com/");
From Tabbed browser:
Opening a URL in the correct window/tab
There are methods available in
chrome://browser/content/utilityOverlay.js that make it easy to open
URL in tabs such as openUILinkIn and openUILink.
openUILinkIn( url, where, allowThirdPartyFixup, postData, referrerUrl
)
where:
"current" current tab (if there aren't any browser windows, then in a new window instead)
"tab" new tab (if there aren't any browser windows, then in a new window instead)
"tabshifted" same as "tab" but in background if default is to select new tabs, and vice versa
"window" new window
"save" save to disk (with no filename hint!)
Also from Tabbed browser, an example of code for an overlay extension which
will open a URL in a new tab, an existing tab, or an existing window
based on which mouse button was pressed and which hotkeys (ex: Ctrl)
are being held. The code given is for a menuitem, but will work
equally well for other XUL elements. This will only work in an overlay
of browser.xul.
XUL:
<menuitem oncommand="myExtension.foo(event)" onclick="checkForMiddleClick(this, event)" label="Click me"/>
JS:
var myExtension = {
foo: function(event) {
openUILink("http://www.example.com", event, false, true);
}
}
In the end, I think I used this technique to get more or less what I wanted to achieve:
The opened tab ("popup") would communicate with a webserver (in my case, in Python) thanks to a JavaScript loaded on it by using an addon like GreaseMonkey.
The server would then tell the popup when to close itself: Worked great!
EDIT: I just thought of an alternative way of doing it (faking it) that might or might not suit your needs (depends on your app).
Open a "popup" (new tab) with the current URL (that's where it might do the trick for you or not) then change the URL of your first page to the "popunder" you were looking for.
I have a pop-up window that I have enabled with tab stops via tabindex=0. When I interact with the page without a screen reader, I can use the tab key to move between the window and form elements that it contains.
When I use my screen reader client (Window Eyes 8.4) to view my website, I cannot consistently tab into the window.
Are there any special cases with code structure that I should be considering that would cause the window to either lose focus or prevent the screen reader from interpreting the markup of the pop-up?
For reference - I'm in a ASP .NET MVC4 web app (page is HTML/CSS/JS) that is generating the pop-up with a Kendo UI [Kendo] Window.
03/17 Update -
The pop-up is intermittently announced by the screen reader as a dialogue box but as soon as the pop-up loads, I can - occasionally - tab into the div and focus is not lost. I am not able to consistently reproduce this and only found this out after pressing the tab key rapidly after pressing the button to show the pop-up.
On the other hand (when not hitting the tab key rapidly), the focus consistently lands at the pop-up without focus outlines (screen reader announces "Foo dialogue box") but on first tab keypress, focus jumps back to the underlying page at the last actionable element before the footer. Pressing tab at this time will then move me into the footer UL element.
It is difficult to answer without a demo, but there are a couple of areas to investigate.
I did a page on the accessibility requirements for a content based pop-up, i.e. one that is not a form. That also includes code on how to manage the focus.
If the pop-up is essentially form based, you might want to try this one on dialogue boxes.
You'll see from those examples that adding tabindex to the container is only part of it, you should manage the focus as well, so that the focus is moved to the pop-up.
The sporadic nature of the issue might be because screen readers generally don't read things that are display:none, and tabbing to something that isn't there may not activate reliably.
If you can post an example I can update this answer.
I have a Telerik RadEditor inside a RadWindow.
My goal is to have it so that when the user presses F11 the RadEditor will fill the entire screen.
Currently,
When I press F11 the radeditor goes fullscreen inside the RadWindow and then browser goes fullscreen.
I tried binding to the OnClientCommandExecuted property and maximizing the RadWindow there but this just results in a small maximized editor within a maximized radwindow. (If that makes any sense.)
Right now I see my only option as using a setTimeout but that can be unpredictable.
Is there a way of knowing when the browser has finished becoming fullscreen?
You can use the resize event to resize your Editor
I try to create a page that will show in a sidebar panel in Opera. I'd like to know when user sees it or not. The problem is when a user closes the panel the page is still active - all javascript functions run - I need to stop them when user closes the panel.
You can not realy detect that. Test the window size when the panel is closed.
To detect active tab in browsers you can use mousemove or mouseover events.
but it dose not work when the mouse is out of your window.