Preventing the start menu from appearing - javascript

I'm writing about the age-old problem of trying to keep the start menu from appearing.
I've read everything I've been able to find on the web, including 2 previous stackexchange threads on closely related topics:
How to disable Windows keys (logo key and menu key) using Javascript
and
Is it possible to block the Windows Key from a web browser?
Now, as people have discussed on those threads, it is not possible to actually block the windows key. I understand that this must be done like that for security, as it would be very dangerous if a script running inside a browser could hijack keys from the operating system. Pretty much for the same reason that a website can never be allowed to go full screen automatically without the user having at least clicked on something.
That's fine.
I'm wondering, however, if instead of trying so desperately to block the windows key, we could instead keep the start menu from appearing. I know it might sound bonkers, but what made me think about it was the solution for dealing with the "context menu" key. Instead of blocking the key, you can just add oncontextmenu="return false;" to the body tag, and then you don't even need to worry about the key.
I understand that the difference between the context menu key and the windows key, is that the context menu appears on the browser, whereas the start menu lies outside the scope of the browser, in the UI of the operating system. But I thought I would ask the question anyway.
For clarity, I'm looking for any solution whatsoever that will allow me to keep the start menu from appearing while my js script is running in the browser, whether it's by blocking the windows key or preventing the start menu from appearing.
Thanks in advance!

Related

What are the proper ways to troubleshoot js drag and drop?

I need to troubleshoot a problem with javascript drag and drop and need some counsel as far as the proper way to do it. I have some experience working in the console and often using inspect in Chrome browser. I don't mind installing other browser extensions if they will help. The problem is a drag and drop function that works in some circumstances and not in others. This takes place on two separate pages of the same type in a Rails application that should have all the same javascript present. My plan of attack is the following but feel free to advise me otherwise:
Find the javascript code responsible for the drag and drop. How do I do that?
Debug the code. I think by setting breakpoints and stepping through it and comparing it on two separate pages, one where it's working and the other where it's not. Will I run into problems debugging, though, since drag and drop requires me to hold down the mouse button and traverse the tracking pad at the same time and the instant I stop I will no longer be running through the drag and drop code?
EDIT: I found Firebug's Profile tab in Firefox and using that I can see that in the page that works just mousing over a blank part of the page fires off 5 js functions, while nothing happens doing the same on the other page. So apparently the working page is listening for events that the non-working page is not, though the pages should be identical in that aspect as they are generated from the same code. Now the question is how can I find out why these listeners aren't there on the non-working page?

Safest way to break Flash focus?

The gist: What's the best way to escape a Flash object's focus on a webpage?
Context:
I have a hotkey listener (an AutoHotKey script) running in my tray. If the script detects the command Alt+Shift+F6 while I am clicked into a Flash object on a webpage, it activates and sends key combinations to Flash to pull certain data logs. After this process completes, I want to call up a JavaScript file on that same browser tab that requests additional information from the user - basically, a tiny UI with additional text fields available in a third-party bug tracker. To do this, I want to send a javascript: command to the address bar using Ctrl+L and having AutoHotKey paste in the full call to the JS file.
A visualization of a possible environment:
The problem:
I need the user to be clicked INTO Flash in order to pull the data logs. However, I need the user to be clicked OUT of Flash for Ctrl+L to actually work - Flash appears to eat all keystrokes at the browser-level when one of its objects has focus.
A possible solution: The easiest way to go about this would be to simulate clicking on the stage, which borders my Flash object on every side. This should work, but I must assume the stupidest possible user. Such a user would somehow limit their current browser window to only be as big as the Flash object (if not smaller), click into it, and attempt to use the hotkey. In this case...I have no idea where I should click, because it could be outside the browser. Further, I don't believe I can assume that all browser address bars are similar amounts of pixels south from the top of the window.
Additional complicating factors:
I want this to work for the user's default browser. (IE, Chrome, Firefox, Safari are my big targets.)
AHK does not provide any native DOM or COM hooks to anything except IE.
Ctrl+Tab and Alt+Tab shenanigans do not appear to work. That can get me to other tabs/windows, but returning to the tab/window with the Flash object still causes Flash to 'eat' further keyboard input.
While I'd be open to using another scripting language than AHK if it could overcome this Flash focus hurdle, I do not know how to create a keylistener that sits in the users tray until activated by a hotkey.
I have no access to the Flash object's code, and it contains no logic to interpret a key combination as a way to break focus or launch a script.
Would it be possible to use WinMaximize to maximize the size of the window? If you do that it should be easier to set up the script to avoid clicking outside the browser.
Perhaps look at ControlFocus and/or ControlSend (using the "edit1" control in IE and FF -- unfortunately, Chrome doesn't expose the "address bar" as a "control" this way but if you test for Chrome first, you can implement your "click outside the Flash box" method for that case).

What is the current behavior of firefox for the ubuntu menu bar?

I'm trying to development an applet (https://github.com/lestcape/Global-AppMenu) to be used in the Cinnamon desktop. My intention is not modify or create any other code than not be cjs (javascript code). All that i do is:
Connect my applet to the com.canonical.AppMenu.Registrar and the Gtk
Dbus API.
Get all object path from the muffin windows manager (a fork of
mutter).
Read and ask things over Dbus and then show the result of
that. I used all patches of Unity desktop, as I'm a user of Ubuntu 14.04.
Nemo, Nautilus, File-Roller, gnome-terminal, VLC, SMPlayer, Evince, are examples of applications that currently are working. At the moment, I only have a problem with one application, and this application is Firefox.
I'm pretty sure that i do something wrong, just i don't have any idea of what could be.
Firefox called the com.canonical.AppMenu.Registrar service perfectly, i also can trigger the Alt key and firefox don't try to show the menubar inside the window, but after some time (a minute), he emit a layout change signal without menu items, and will show the menubar to the user inside the main window, as is "normally".
My idea is that: this could be, because i'm missing to call some aboutToShow, or because firefox require a confirmation that i receive the menubar, and he required really that this will be done for the same GDBus Connection where he exported the menu bar, but i can not be sure who internally will be handled in that way, as i'm on javascript.
Any way the firefox behavior, apparently is a behavior with an know cause, and what i try to find is the cause of that behavior, to then I will try to find a solution.
Thanks and regards.
Firefox and thunderbird require a returned confirmation value from the Dbus connection, as i say in the question. This value is not returned in the default cinnamon code, i force to return the value and now the problem is resolved. Thanks anyway.
Try to look at the about:config page and search for the "ui.use_unity_menubar" entry. As I know, this setting toggle between using unity global menu or normal menu. Maybe this could help you.
Good luck with your applet, I'm waiting for more stable release and then I will give it a try.

Javascript disable switches current tab functionality in browser

Is there a way to accomplished this on browser?
Disable opening another web page
or disable switch current tab functionality in browser
when certain page (in this case my page) is still open?
I want to make a quiz in web, but i want to eliminated the posibility for user search on internet for the answer, but have no idea how to accomplished that.
plis give me a solution..
regards..
No, this isn't possible, for (what I hope are) obvious reasons.
This not possible.
Even if it was possible in theory, how would you stop the user opening another browser (different brand to the current one)?
How would you stop the user from using their mobile phone to search the web?
If this quiz is being run in a controlled environment (like a classroom) you could run the web browser in some sort of kiosk mode with strict policy setup against opening other tabs etc. But if it is being run in a classroom, then you already have someone supervising anyway. Why bother then

Can we disable browser's buttons(back/forward/refresh) by javascript [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Disable browser's back button
Is there any way to disable browser(specifically IE) BACK button, FORWARD button, REFRESH button by javascript. So that, when ever any user will click on any button nothing will happen.
No, you cannot reliably, reasonably do that. Even IE's "kiosk mode" allows back, forward, and refresh (via keyboard shortcuts).
On an actual web page (a real page out on the web), disabling back/forward/refresh would of course be extremely inappropriate behavior and I assume that's not what you're trying to do. (Instead, use history libraries and such to ensure your page/web app actually works with the back and forward buttons to do what the user expects.)
Mind you, if you provide a link that opens a new window (which will probably actually end up being a new tab in most modern browsers), your page will be the first page in that window's history and so the Back button will automatically be disabled. And if your page doesn't offer any links anywhere else, it'll stay that way. And if the user hasn't gone Back, by definition they can't go Forward. Nothing you can do about Refresh, though.
If you have a genuine reason for actually disabling those actions (some kind of intranet application, that sort of thing), you'll probably have to distribute an actual application (for instance, .Net app via No Touch Deployment or similar) that incorporates a web browser control, which gives you the HTML/CSS/JavaScript environment but with dramatically higher control over that environment.
As far as I know, you can't modify the buttons in a browser with scripts.
Since you're working with IE, you may be able to use either VBScript or JScript, but I doubt you'll be able to disable the reload button.
More reading:
http://www.webdeveloper.com/forum/showthread.php?t=62177

Categories

Resources