Bookmarklet for enabling the Chromevox extension - javascript

The Chromevox extension hijacks my letter "a" so that it activates and deactivates my enabled Chromevox extension. That means if I'm typing something, everytime I hit the letter "a" Chromevox does something. So I need to disable the Chromevox extension when I'm not using it. Opening the extension maanager for this is a pain. I'd like to have a custom keyboard shortcut or bookmarklet to toggle Chromevox enabled or disabled. I think the javascript
chrome.management.setEnabled(string id, boolean enabled, function callback)
should do it, but I don't know how to find the string. Any ideas? I'm running Pop!_OS 20.04 which is more or less Ubuntu 20.04.

As so often happens, I figure out a solution right after posting. If you turn the extension on, from within the extension manager page, there is a hamburger menu. Press that and choose keyboard shortcuts. There are a number of shortcuts for Chromevox. The last on is toggle Chromevox classic. Change "In Chrome" to "Global." When you hit the shortcut, it changes the Chromevox key; so that now you can type without problems. When you are done typing, use the same shortcut to go back.

Related

How do I simulate a keyboard enter button press in JavaScript/jquery that is not selector specific?

I need a real, keyboard press simulation.Not one that is only selector specific. I need a way to simulate an actual enter button press on the keyboard, in JavaScript. This way the enter press will work the same every where i decide to trigger it , hence making it an actual enter button on a keyboard, simulation. Please help :) (I am using this in imacros and recording wont cut it because it is specific and not universal)
For security reasons, browsers won't allow you to simply simulate the pressing of a key from a browser context. If this were possible, then a user could load a web page and the javascript on the web page could take over the keyboard and do nasty things to the computer.
For a more detailed explanation, as well as some alternatives, see this post.

How to hide Find Bar in browser? (cancel Ctrl+F by javascript after it was already invoked)

When user presses Ctrl+F on keyboard, browser shows a find box where user can type some text and browser finds occurrences of that text on the current webpage. I would like to keep this feature, but once my users clicks somewhere on the webpage, for example on a certain input element, I want chrome to cancel the finding - to stop - to hide the find box.
How to do that in JavaScript?
At least in chrome...
I know there is a possibility to intercept all keyboard events and cancel the Ctrl+F keystroke in general so the find bar never appears, but this is not my goal, as I wrote I want this to be preserved, but auto-hide programatically.
I noticed that the find box disappears if navigating away from the webpage, I tried to 'navigate away' by adding a #hash to the location.href but this didn't seem to work. I actually cannot navigate away, but maybe some similar hack could help?
$(window).keypress(function (e) {
return !(e.which == 102 && e.ctrlKey)
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Using jQuery this code is correctly working in Firefox. But Chrome didn't generate event if you are using Ctrl+F shortcut. And you can't rewrite browser`s behaviors using JS. You can rewrite it if you will write the plugin for browser

Overriding web application keyboard shortcuts

I think this question is going to be rare, hence enjoyable for some. I have two products - Salesforce's Developer Console & Google Chrome.
Google Chrome has built in hotkey - ctrl + page up/down to switch tab.
Unfortunately Salesforce's Developer Console uses the same hotkey to switch between tabs within console.
Now I will contact Salesforce support and maybe 3-6 months later they will fix the problem. I suppose contacting Google for support is ...
I have tried Shortcut Manager extension for Chrome but it does not have the option to disable the mentioned hotkey.
I was thinking wether it would be possible to overwrite the integer value in keyCode in Salesforce's script?
I've read somewhere that browser Extensions do not have such access. Not sure whether that is true, but then perhaps something like Privoxy could work?
Thank you all.
To enable and customize keyboard shortcuts:
From Setup, click Create | Apps.
Click Edit next to a Salesforce console app.
Click Customize keyboard shortcuts.
Click Edit on the top of the page.
Select Enable keyboard shortcuts.
Edit an existing keyboard shortcut or create a new one:
To edit a shortcut, click Edit next to the shortcut, type the combination of key commands to use, and click OK.
To create a shortcut, click +Add Keyboard Shortcut, type the action the shortcut will perform, a Console Event Name, which is a unique identifier, the combination of key commands to use, and click OK. For the new shortcut to work, you must send the Console Event Name to the developer who defined your shortcut’s action so that he or she can add it to the method that will trigger your shortcut.
To deactivate a shortcut, deselect Active next to the shortcut’s name. You can’t delete the default shortcuts provided by Salesforce, but you can edit or deactivate them.
Click Save.
More info here.

How to disable JavaScript in Chrome Developer Tools?

I am trying to debug the features of a website when users disable their JavaScript. I was wondering how do you disable JavaScript for a page from the Google Chrome DevTools?
Click the gear icon in the corner of the Developer Tools, click Settings, then under Debugger, check Disable Javascript, as shown in the following video:
Update August 2020
Developer Tools (F12)
Click the Gear icon
Should open the Preference tab
Disable Javascript option is on the far right
Original answer
Developer Tools (F12)
Three vertical dots in upper right
Settings
Under the "Preferences" tab on the left
There will be a "Debugger" section with the option (probably on far right)
Official documentation: Disable JavaScript With Chrome DevTools
There's now a command menu built into DevTools that makes it easier to disable JavaScript. This has been around as of April 2016 or so.
Open DevTools.
Press Command+Shift+P (Mac) or Control+Shift+P (Windows, Linux) to open the Command Menu. Make sure that your cursor's focus is on the DevTools window, not your browser viewport.
Type Disable JavaScript (or some version of that... it's a fuzzy search) and then press Enter.
Use the Enable JavaScript command when you want to turn it back on.
chrome://settings/content Javascript/Manage Exceptions
This extension makes it faster (I am the author) : Quick Javascript Switcher
It is open source: https://github.com/maximelebreton/quick-javascript-switcher
You can also run Chrome with JavaScript disabled by default by using the flag:
-disable-javascript
You would use this for example by running Chrome like this:
C:\Documents and Settings\%username%\Local Settings\Application Data\Google\Chrome" -disable-javascript
The quickest way is problably this one:
F12 to open the dev console
ctrl + shift + p to open the command tool (windows)
Type 'disable javascript' and hit enter
On OSX, I had to click the triple vertical dots, and uncheck a box in the settings section. Which can also be opened with f1
Using only the keyboard at least for Windows 10:
F12, shows Developer Tools
F1, shows Settings
tab, moves to the "Disable Javascript" check box
space, toggles the option
esc, hides Settings
The fast way:
1) just click on CTRL + SHIFT + P
2) fill the field by the 3 letters dis and will appear this box and select the item Disable Javascript
.
that's all folks!
On Mac OS X:
Preferences
Show advanced settings
Press the "content settings" button
Scroll to the "JavaScript" section
Check the checkbox in front of "Do not allow any site to run JavaScript"
The Chrome Quick JavaScript Switcher extension is a lot easier though :-)
Go to options (Windows: three vertical dots in the top right) -> Settings, or hit F1.
In the General section you find "disable JavaScript"
The gear icon is no longer part of developer tools. Since Chome 30.0 it is not even possible to bring it back (In Google Chrome Developer Tools, the toolbar icons disappeared. What gives?)
To temporarily block JavaScript on a domain :
Click on the Button left to the address on the address bar (which says View site information)
In the drop-down next to JavaScript, select Always block on this site
Reload Page
Click the ⋮ menu in the corner of the Developer Tools, click Settings
Click on Advanced at the bottom
Click on Content Settings
Click on JavaScript
Switch off
Full and fast instructions for Chrome browsers (Opera incl.)
The first way
If Developer Tools aren't open then press F12 key on keyboard to show the Developer Tools. In Opera browser you have to use key combination Ctrl + Shift + i on keyboard to open it.
To show the settings just press F1 key on keyboard. The Developer Tools window must be focused when you are doing it. Or if you want to open the settings with the mouse then you have to click on ⋮ button in the top right corner of the Developer Tools, then click Settings in the menu.
Then you have to scroll down the settings window to bottom and then you will see the checkbox for disabling JavaScript like follows:
Just click on this checkbox and push esc key on keyboard for hide the settings. If you want to enable it then you have to do the same way again.
The second way
If Developer Tools aren't open then open it like in the first way is described.
Press the key combination Ctrl + Shift + P (for Windows or Linux) or Cmd (⌘) + Shift + P (for Mac) to open the Command Menu. Be sure that the focus is on the DevTools window.
Type there "Disable JavaScript" and then press Enter or click it with the mouse. If you want to turn back the enanled JS then open the Command Menu again and type there "Enable JavaScript" and then press Enter or click it with the mouse. You could also write just only "JavaScript" or "Java" there and then choose it with the mouse.
If all this does not work
For some reason it is possible that it does not work. I this case open a new empty site in "Incognito Mode" and do all this there.
The quickest way
In Chrome Web Store or on Opera Addon site you can find and install extensions which do it per one click. Just search "Javascript Switcher":
For Chrome browser
For Opera browser
Press F8 for temporarily freezing / unfreezing JS (with DevTools open).
This is very useful for debugging UI issues on elements that may lose focus if you click or press anything outside of that element. (Chrome 71.0.3578.98, Ubuntu 18.10)
Paste it: chrome://settings/content
Go to "Javascript" section and disable it.
Chrome://chrome/settings/Privacy/Content settings/JavaScript
and there you can PASTE your website's URL in Manage exceptions.. and change the JavaScript priority from ALLOW to BLOCK.
This is the latest setting for the windows
Settings > Advanced > Privacy and security > Site Settings > Javascript > Blocked then get switch on and off
good question, i try so many way, but it is curry and boring, until i find shortcut.
alt + cmd + i, this open dev tools, unless you use pocket, that need set other shortcut.
shift + cmd + p, then input: javascript
only two shortcut, but i think safari is more convenient for that.
There's a settings in chrome
open the menu from chrome,
click settings > type in "javascript" in the search bar > click site settings > click javascript.
from here you can toggle javascript specifically to a site using their url.
or just click the big button to allow/block it to all sites.
I arrived here simply wanting to know how to disable javascript in chrome:
Right click on the website
Click "inspect"
Hit keys: ctrl + shift + p
Type: "Java"
Click "disable JavaScript"
Refresh page
It's from here

Firefox javascript bookmarklet open tab in background

I've written a bookmarklet to look a word up in a Chinese dictionary:
javascript:Qr=document.getSelection();if(!Qr){void(Qr=prompt('%E8%AF%8D%E8%AF%AD',''))};if(Qr)(function(){window.open('http://nciku.com/search/all/'+Qr);})();
This opens a new tab with search results for your selected word or a word you type in at the prompt. Is there a way to load the new tab in the background? I'd like to keep the focus on the page I'm looking at, and look at the search results later.
There is an option "When I open a link in a new tab, switch to it immediately" in Firefox, this doesn't help.
Edit: Note that this is for my use, so an answer that tells me how to change Firefox (3.0.11) settings to do this would work as well. Also I've tried the following modification, but it's still focusing the new tab.
javascript:Qr=document.getSelection();if(!Qr){void(Qr=prompt('%E8%AF%8D%E8%AF%AD',''))};if(Qr)(function(){var%20oldWin=this;window.open('http://nciku.com/search/all/'+Qr);oldWin.focus()})();
Edit 2:
Looking around to see if I can find an answer I see this guy who's got the opposite problem (new tabs don't get focus, but he wants them to have it), but with no resolution:
Possible to set tab focus in IE7 from JavaScript
There's apparently talk about a _tab target in HTML 5, but that doesn't help me much.
http:/ /forums.whatwg.org/viewtopic.php?t=185&highlight=tab+focus
(apparently as a new user I can only post one link, so I've mauled it)
This seems pretty broken browser behaviour if this is impossible.
In FireFox type about:config and change browser.tabs.loadDivertedInBackground to true.
This has worked for me with browser bookmarklets.
source: http://lifehacker.com/263940/force-links-to-open-in-the-background
No, not programmatically through JavaScript. You don't have control over the user's browser preferences, only they have control over that.
Moreover, even if you did have control over that, you shouldn't do it, because it undermines the control that your script is given to you by the browser. If the user wants a page to open in the background, they should be able to control it, not you, as the developer.
Apparently this is only possible with previously opened windows, not the root window.
Calls to window.open with the same
window name as an already existing
window, loads the URL into that window
and gives a reference to the window
back. The window isn't given focus,
its opener property isn't changed, and
a third argument to window.open is
ignored. You can use the focus method
to give the window focus manually.
var oldWin = window.open("url.html","oldName");
oldWin.focus(); // give focus
Facing the same issue, I only noticed that if you alert() something just after opening the window, Firefox would not switch to the newly opening tab.

Categories

Resources