From 3b2139d2d7dcc587332c52f6deb1e2f093449e38 Mon Sep 17 00:00:00 2001 From: Markus Jarderot Date: Sat, 27 Aug 2016 22:37:04 +0200 Subject: [PATCH 1/2] Prevent intercepting typing in a textarea. --- inject.js | 1 + 1 file changed, 1 insertion(+) diff --git a/inject.js b/inject.js index df39eab..dc28b22 100644 --- a/inject.js +++ b/inject.js @@ -193,6 +193,7 @@ chrome.extension.sendMessage({}, function(response) { // Ignore keydown event if typing in an input box if ((document.activeElement.nodeName === 'INPUT' && document.activeElement.getAttribute('type') === 'text') + || document.activeElement.nodeName === 'TEXTAREA' || document.activeElement.isContentEditable) { return false; } From 7e0ca9c97cab6fe43ab9a40d0d3fe0556973b74a Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Thu, 1 Sep 2016 01:09:52 -0500 Subject: [PATCH 2/2] fix double controller on Coursera --- inject.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/inject.js b/inject.js index dc28b22..8df5968 100644 --- a/inject.js +++ b/inject.js @@ -218,7 +218,15 @@ chrome.extension.sendMessage({}, function(response) { function checkForVideo(node, parent, added) { if (node.nodeName === 'VIDEO') { if (added) { - if (!node.classList.contains('vsc-initialized')) { + if (!node.classList.contains('vsc-initialized') && !node.dataset['vscid']) { + new tc.videoController(node, parent); + } + // if the video has already been initialized, then it has been mutated + // we may need to update the controller location to reflect this + else { + let id = node.dataset['vscid']; + let ctrl = document.querySelector(`div[data-vscid="${id}"]`); + if (ctrl) ctrl.remove(); new tc.videoController(node, parent); } } else {