📜 ⬆️ ⬇️

Mouse gestures extension for Chrome 3.0.196.x

On Habré already told about the remarkable extension for Chrome, allowing to manage myszhestami. But starting from version 3.0.196.0 from Chrome's JS engine (correct if I am mistaken) the contentWindow object disappeared ( here Aaron Budman tells why and why), which was used in the specified extension. In the current version of chromegestures (1.0.7), the problem has not yet been fixed.

It’s easy to understand that the extension doesn’t work precisely because of this: every time you load any page (with the extension installed, of course), the “ContentWindow is not defined” error message appears in DeveloperTools.

I really wanted to try gestures in Chrome, so I went to ChromeGestures.user.js and stupidly commented out all 4 lines using contentWindow (as it turned out later, this is not at all necessary, read upd3 below). Obviously, after such cruelty, something will not work or will not work (I didn’t really want to read the code, and I’m not so strong in js), but at the moment it’s better than nothing =) will come in handy.
')
upd:
A small manual.
Go to C: \ Documents and Settings \ Administrator \ Local Settings \ Application Data \ Google \ Chrome \ User Data \ Default \ Extensions \ chlbjhngbajmncdidibolcjokpchfhlf \ 1.0.7 \ (WinXP. Vista should have something like C: \ Users \ Local \ AppData \ ... and onwards likewise). Not sure, however, that the bold part of all will be the same. We find there the mentioned ChromeGestures.user.js, in it we fix
function getData(ntpurl,delta,captime,clickto){
newTabURL = ntpurl;
ChromeGesture.MINIMUM_DELTAY = delta;
ChromeGesture.MINIMUM_DELTAX = delta;
ChromeGesture.DELAY_BETWEEN_CAPTURES = captime;
ChromeGesture.CLICK_TIMEOUT = clickto;
if (popupLoader && contentWindow.CHROMEGESTURES_loadData){
wind.close();
contentWindow.CHROMEGESTURES_loadData = false
wind = null ;

}
}
if (!us)contentWindow.CHROMEGESTURES_setData = getData;

// LOAD SAVED DATA
if (!us){
if (popupLoader){
contentWindow.CHROMEGESTURES_loadData = true ;
wind = window.open( "chrome-extension://" +chrome.extension.id_+ "/options.html" , "_blank" ,
"directories=no,height=1,width=1,left=-100,top=-100,location=no," +
"menubar=no,scrollbars=no,status=no,titlebar=no,toolbar=no" );
}


* This source code was highlighted with Source Code Highlighter .

on
function getData(ntpurl,delta,captime,clickto){
newTabURL = ntpurl;
ChromeGesture.MINIMUM_DELTAY = delta;
ChromeGesture.MINIMUM_DELTAX = delta;
ChromeGesture.DELAY_BETWEEN_CAPTURES = captime;
ChromeGesture.CLICK_TIMEOUT = clickto;
if (popupLoader /*&& contentWindow.CHROMEGESTURES_loadData*/ ){
wind.close();
//contentWindow.CHROMEGESTURES_loadData = false
wind = null ;

}
}
//if(!us)contentWindow.CHROMEGESTURES_setData = getData;

// LOAD SAVED DATA
if (!us){
if (popupLoader){
//contentWindow.CHROMEGESTURES_loadData = true;
wind = window.open( "chrome-extension://" +chrome.extension.id_+ "/options.html" , "_blank" ,
"directories=no,height=1,width=1,left=-100,top=-100,location=no," +
"menubar=no,scrollbars=no,status=no,titlebar=no,toolbar=no" );
}


* This source code was highlighted with Source Code Highlighter .

(sorry for a big piece of code)

upd2: transferred to the Google Chrome blog

upd3: attentive life4beer Habrayuzer suggested that it is not necessary to comment, it is enough to replace the contentWindow with a window.

Source: https://habr.com/ru/post/66508/


All Articles