Difference between revisions of "SD working with Google Chrome"
(New page: == Overview == How to get SD (tested on SD 12.1) working with [http://www.google.com/chrome Google Chrome] browser (or any clones like [https://www.srware.net/en/software_srware_iron_downl...) |
(No difference)
|
Latest revision as of 07:44, 6 October 2011
Overview
How to get SD (tested on SD 12.1) working with Google Chrome browser (or any clones like SRWare Iron or Comodo Dragon).
Speed of using SD (e.g. screen/window creating) is fastest i've seen till now (Note: if you want fastest experience disable all extensions with switch --disable-extensions).
Some minor issues are still present. Like f.e. attachments which get wrong name or some visual stuff, but overall it works great.
Usage
Firstly you don't have to replace files in PDA/Mobile section or something, just use a different user agent by starting Chrome with switch --user-agent (f.e. --user-agent="Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0")
Now to get back the missing menubar you have to make some changes to the function setup_for_menubar. Below the complete function including the added code. Add this code to sitemods.js
<source lang="javascript"> var retry_count = 0; function setup_for_menubar(name) {
//dLog("setup_for_menubar(" + name + ") [" + window.parent.name + "]");
window.__menuBar = void(0);
window.menubarFrame = void(0);
var mbFrame;
for (var w = window; w != null && w != ahdframeset && w != w.parent; w = w.parent)
{ if ((typeof w.frameElement == "object") && (w.frameElement != null) && (w.frameElement.tagName == "IFRAME") && (! w.name.match(/menuOK/))) break;
mbFrame = w.parent.frames["menubar"];
//When browser is Chromium based, get the menubar frame in a different way (original didn't work)
if (typeof navigator.vendor != "undefined") //vendor attribute does not exist (IE) { if (navigator.vendor.match(/Google/)) { var myNodeList = new Array(); myNodeList = w.parent.document.getElementsByName("menubar"); for (var i = 0; i < myNodeList.length; i++) { if ((typeof mbFrame == "undefined") || (mbFrame.name != "menubar")) mbFrame = myNodeList[i].contentWindow; // Get MenuBar Window (which contains object __menuBar) } } }
if (typeof mbFrame == "object" && mbFrame != null && mbFrame.name == "menubar")
break;
}
if ((typeof mbFrame == "object") && (mbFrame != null))
{
if ((typeof mbFrame.__menuBar != "object") || (mbFrame.__menuBar == null))
{
retry_count++;
if (retry_count < 10)
{
var timeout = retry_count * 100;
if ( typeof name == "string" )
window.setTimeout("setup_for_menubar('" + name + "');", timeout);
else
window.setTimeout("setup_for_menubar();", timeout);
}
}
else
{
// We only build menus if there is a menubar frame at our level. This
// avoids peculiar results for windows containing deferred tabs.
window.menubarFrame = mbFrame;
window.__menuBar = mbFrame.__menuBar;
window.__menuBar.deferSetupCompletion = ahdtop.cstUsingScreenReader;
window.menubarOnload = null;
if ( typeof name != "string" ) { if (typeof propFormName != "string") name = ""; else { name = propFormName; if ((typeof propFormName3 == "string") && (propFormName3.length > 0)) name += "_" + propFormName3; } if (typeof argID == "string") name += "_" + argID; if ((typeof rptName != "undefined") && (typeof argSearchSqlClause == "string") && (argSearchSqlClause.length > 0)) name += "_" + argSearchSqlClause; if ((typeof cawf_procid == "string") && (cawf_procid.length > 0)) name += "_" + cawf_procid; // Ensure menu is refreshed after change order attach/detach if (typeof argChange == "string") { if (! argChange.match(/^\s*$/)) name += "_attchg"; } if ((typeof argActive == "string") && ((typeof cfgNX_EDIT_INACTIVE != "string") || (cfgNX_EDIT_INACTIVE != "no"))) name += "_" + argActive;
}
window.menubarName = name;
// We build the menubar right away to get the hotkeys right
find_build_menubar();
// We also set an onload in case the user presses the Back button
if (typeof window.onload != "undefined")
window.menubarOnload = window.onload;
window.onload = find_build_menubar_onload; } }
} </source>
And now to let it default select a tab for you:
- Change toolbar.htmpl to let it call the function zLoadOK() instead of LoadOK() in the onload event.
- Add the following code to sitemods.js
<source lang="javascript"> function zLoadOK() { //When browser is Chromium based, get the toolbar frame in a different way (original didn't work) if (typeof navigator.vendor != "undefined") //vendor attribute does not exist (IE) { if (navigator.vendor.match(/Google/)) { var myNodeList = new Array(); var tbFrame; for (var w = window; w != null && w != ahdframeset && w != w.parent; w = w.parent) { myNodeList = parent.document.getElementsByName("toolbar"); for (var i = 0; i < myNodeList.length; i++) { if ((typeof mbFrame == "undefined") || (mbFrame.name != "toolbar")) { tbFrame = myNodeList[i].contentWindow; // Get ToolBar Window (which contains tabClick method) tbFrame.tabClick(parent.toolbarInitialTab); break; } } } } else //Call original function loadOK(); } else //Call original function loadOK(); } </source>