@@ -175,7 +175,14 @@ <h3>Display handler</h3>
175175 print("text = %s")
176176
177177def OnStatusMessage(self, browser, value):
178- print("ClientHandler::OnStatusMessage()")
178+ if not value:
179+ # Do not notify in the console about empty statuses.
180+ return
181+ self.statusMessageCount += 1
182+ if self.statusMessageCount > 3:
183+ # Do not spam too much.
184+ return
185+ print("DisplayHandler::OnStatusMessage()")
179186 print("value = %s" % value)
180187
181188def OnConsoleMessage(self, browser, message, source, line):
@@ -215,16 +222,16 @@ <h3>Request handler</h3>
215222< pre >
216223def OnBeforeResourceLoad(self, browser, frame, request):
217224 print("RequestHandler::OnBeforeResourceLoad()")
218- print("url = %s" % request.GetUrl())
225+ print("url = %s" % request.GetUrl()[:70] )
219226 return False
220227</ pre >
221228See messages in the console.
222229
223230< pre >
224231def OnResourceRedirect(self, browser, frame, oldUrl, newUrlOut):
225232 print("RequestHandler::OnResourceRedirect()")
226- print("old url = %s" % oldUrl)
227- print("new url = %s" % newUrlOut[0])
233+ print("old url = %s" % oldUrl[:70] )
234+ print("new url = %s" % newUrlOut[0][:70] )
228235</ pre >
229236Try this:
230237< a href ="http://tinyurl.com/google404redirect ">
@@ -287,8 +294,9 @@ <h3>Request handler</h3>
287294
288295< pre >
289296def OnProtocolExecution(self, browser, url, allowExecutionOut):
290- # This callback seems not to work on Linux, see here:
291- # http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10901
297+ # There's no default implementation for OnProtocolExecution on Linux,
298+ # you have to make OS system call on your own. You probably also need
299+ # to use LoadHandler::OnLoadError() when implementing this on Linux.
292300 print("RequestHandler::OnProtocolExecution()")
293301 print("url = %s" % url)
294302 if url.startswith("magnet:"):
@@ -301,8 +309,8 @@ <h3>Request handler</h3>
301309
302310< pre >
303311def _OnBeforePluginLoad(self, browser, url, policyUrl, info):
304- # This callback seems not to work on Linux, reported here:
305- # http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10901
312+ # Plugins are loaded on demand, only when website requires it,
313+ # the same plugin may be called multiple times.
306314 print("RequestHandler::OnBeforePluginLoad()")
307315 print("url = %s" % url)
308316 print("policy url = %s" % policyUrl)
@@ -313,8 +321,9 @@ <h3>Request handler</h3>
313321 # False to allow, True to block plugin.
314322 return False
315323</ pre >
316- If you have Flash installed then you should already see a message
317- in the console.
324+ Try OnBeforePluginLoad() with Flash:
325+ < a href ="http://www.adobe.com/software/flash/about/ ">
326+ http://www.adobe.com/software/flash/about/</ a >
318327
319328< pre >
320329def _OnCertificateError(self, certError, requestUrl, callback):
@@ -346,9 +355,10 @@ <h3>Cookie tests</h3>
346355See messages in the console.
347356
348357< pre >
349- def GetCookieManager(self, browser, mainUrl):
358+ def GetCookieManager(self, browser, mainUrl):
350359 # Create unique cookie manager for each browser.
351- # Buggy IO thread callbacks, need to update to revision 1306, see:
360+ # --
361+ # Buggy implementation in CEF, reported here:
352362 # http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10901
353363 cookieManager = browser.GetUserData("cookieManager")
354364 if cookieManager:
0 commit comments