How can I get notification of page load events in Chrome? - google-chrome

I need to be able to monitor navigation events (such as page loads or switching between active tabs) in browsers running on a Windows PC. So far, I can get this to work in IE and Firefox by loading a DLL into all running apps via a call to SetWindowsHookEx, then asking for either the IHTMLDocument2 (in IE) or nsIWebProgress (in Firefox) interface from the application. I can use the appropriate interface to request a callback from the application when an event of interest happens.
Is there a way to do this in Chrome? I have read a little about Chrome extensions, but I have not found any documentation on an API exposed by Chrome that is analogous to COM in IE or XPCOM in Firefox. Will a similar approach work or will I need to do something completely different? (I am working in C++.)
I would appreciate it if someone could at least point me in the right direction.
Thanks.

With Chrome extensions API you can register some events handlers for changing state of tab like when document state is changed (loading or loaded), when new tab is added/removed from window or when user switch between tabs.
More about tabs events You find on http://code.google.com/chrome/extensions/tabs.html#event-onActiveChanged

Related

How to clear cache in Qlik Sense desktop?

I've been debugging a button extension issue for a button that does not work on only a few user's local machines. Over the past couple of days, I've narrowed the problem to the user's cache. With that, the bug is easily replicable.
Clearing the cache and loading the Qlik app in Google Chrome at localhost:4848/hub, the app's buttons will work. However, the app will continue to not work in the Qlik Sense desktop application itself. Because Qlik Sense is a skin over Chromium, I figured a simple reset of its cache will fix the bug for the few users that are experiencing this. Unfortunately, I'm unable to find a solution specifically for Qlik Sense via both Google and the Qlik Community Forums.
Is clearing the cache in the desktop application possible? If so, how do I go about it?
Scouring the Community Forums and Google, it appears a GUI interface to clear cache once existed, but now doesn't. If so, was it deprecated?
Thank y'all!
Since Chrome is involved then the default shortcuts will work. The shortcut below will reload the page ignoring the cache
This is from Google's support page (Web page shortcut section)
If you want to be more "brutal" :) you can manually delete the content you don't want through the Chrome Dev tools:
on the page, in QS Desktop, with the dashboard press Ctrl + Shift + Mouse right click
this should bring the context menu
select Show DevTools
navigate to Resources tab
expand Session Storage
you should see only one item http://localhost:4848. Click it
on the right side you will see all entries in Key <-> Value format (probably you have only one)
right-click on it and press Delete
refresh the page (F5)

chrome.desktopCapture throws an error on "tab" as DesktopCaptureSourceType

I am developing a chrome extension, and my point here is to record a browser tab , like Screencastify chrome extension records the browser tab. I referred desktopCapture , a chrome API which works perfectly for "screen" and "window" as DesktopCaptureSourceType, whereas for "tab" as DesktopCaptureSourceType, it throws an error as
desktopCapture.chooseDesktopMedia: Tab capture is not supported yet.
I have configured the required permissions in manifest.json of my extension. Could anyone suggest me a solution?
P.S : I need to record the chrome browser tab only, am not asking for a screen or window recording
This is a known issue: https://crbug.com/488262
However, you can use the chrome.tabCapture api instead. The downside is that you will have to split your interface between capturing tabs and screens/windows, as chrome.tabCapture doesn't provide an equivalent picker.
Why does Google have two separate screen capture apis? Good question.
The stream object generated by the chrome.tabCapture cant be shared outside the plugin code.
You will have to write the code to share the stream to server within the chrome plugin.

IT Hit WebDAV AJAX Library on Chrome becomes unresponsive

I am experiencing an issue with opening a Microsoft Office Document, using IT Hit WebDAV AJAX library, in latest Chrome 39.0. running on Windows OS. It is a sporadic issue that occurs only in Chrome, and it happens when one opens a document multiple times. Word instance won't start, the page freezes and browser becomes unresponsive, and Chrome suggests killing the page. The only solution is restarting the browser, which solves the issue.
I have tried opening a document in Chrome on Mac OS X, and it is working fine. So are Mozilla and Safari on all operating systems. It seems to be a Chrome + Windows issue only.
Has anyone experienced this issue and is there a fix?
The Microsoft Office plug-in that opens the document displays a warning popup "Some files can harm your computer.", which is a modeless dialog:
If you quickly click on a link that opens the document more than one time the dialog will hide behind the main web browser window. As a result the web browser window is blocked.
You need to switch to that dialog and confirm or reject document opening, otherwise after some time Chrome will ask you if to kill the page or wait.
Note that there is no way to avoid that dialog, this is a built-in MS Office functionality as far as I know.
Chrome will only work good with ITHitWebDAV if the user has got Office 2013 or superior.
Google is blocking all Java applets and NPAPIs now, so good luck with that. I just detect the browser of the user that wants to edit a document, and if it's chrome, I warn him to change to another browser like Firefox with a modal, and that's all.
Very poor support between Chrome and ITHitWebDAV, and no much you can do about it.

Re-enable WebGL without restarting Chrome

When Chrome stops WebGL and gives you the following error (in a yellow banner on top of the screen): "Rats! WebGL hit a snag...", and reloading does not work (WebGL is still not re-enabled), is it possible to re-enable WebGL without restarting Chrome?
Context:
Chrome disables WebGL probably because it requires too many resources: I ask it to display 400,000 billboards on Cesium, for those who know what this is.
I know how I could reduce the resources my app asks for, but actually I am exploring its limits for testing purposes. So I am going to make Chrome disable WebGL a lot of times, and I do not want to restart it everytime it disables WebGL.
My configuration:
Chrome 35.0.1916.114 m
Windows 7 Pro 64 bit.
Solutions explored:
I already tried to open a new Chrome window, it does not work. For the moment all I can do is close all Chrome windows and restart it.
I already tried to put --ignore-gpu-blacklist in the Chrome shortcut (even if I understood this is for Windows XP, right?).
Hope I was clear enough.
Thank you for your help.
I was having the same problem and I just found a solution. It sounds like this didn't work back when this question was posted but, it works now!
Refreshing the page doesn't work. If you clicked a link from a different tab to open the tab the crashed, clicking that link again doesn't work. You have to open a new tab and paste in the URL of the page that you want to reload.
I'm guessing this is due to chrome threading... by opening a brand new tab, you create a new thread instead of using the existing one.
In your application you should properly handle webglcontextlost and webglcontextrestored events. In particular, you should prevent default event action in webglcontextlost handler thus telling the browser that you can restore proper functioning of your app when webglcontextrestored will be fired.

Does Google Chrome Frame break IE8 console output?

This is a question about debugging a project, not about writing the code.
I am on the final stages of developing an HTML5 web app. Fairly last minute, our client tells us it should run on IE8. Since I use the HTML5-canvas in the app, this required the addition of Google Chrome Frame. Once installed and testing, however, IE8's developer console no longer prints any data, and the HTML viewer never loads. Is this a bug? Is there a way to fix it? It will really suck if I need to debug with alerts...
From Google Chrome Frame documentation:
You can use the Web Inspector in GCF just as you would in the Google Chrome browser. To use it, right-click and choose "Inspect Element". Logging is available via the console.log method, and you can set breakpoints and inspect network activity.