From 4e7736bc10801897e778c8b213c9c5b8619bfe6a Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 2 Jan 2016 19:33:32 -0500 Subject: [PATCH] this fixes #1124 --- platform/chromium/vapi-client.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/platform/chromium/vapi-client.js b/platform/chromium/vapi-client.js index eb0319ef4..5b9d3bc6a 100644 --- a/platform/chromium/vapi-client.js +++ b/platform/chromium/vapi-client.js @@ -29,6 +29,15 @@ /******************************************************************************/ +// https://github.com/gorhill/uBlock/issues/1124 +// Looks like `contentType` is on track to be standardized: +// https://dom.spec.whatwg.org/#concept-document-content-type +if ( (document.contentType || '').startsWith('image/') ) { + return; +} + +/******************************************************************************/ + var vAPI = self.vAPI = self.vAPI || {}; var chrome = self.chrome; @@ -60,7 +69,7 @@ vAPI.shutdown = (function() { var exec = function() { //console.debug('Shutting down...'); var job; - while ( job = jobs.pop() ) { + while ( (job = jobs.pop()) ) { job(); } };