Open Bug 1295221 Opened 10 years ago Updated 3 years ago

"TypeError: event.stopPropagation is not a function" when middle-clicking in Treeherder

Categories

(Firefox :: General, defect)

x86_64
Linux
defect

Tracking

()

Tracking Status
firefox51 --- affected

People

(Reporter: botond, Unassigned)

Details

STR: 1. Run Nightly on Linux 2. Load https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound 3. Be sure autoscrolling is disabled in about:preferences -> Advanced 4. Middle-click on the page This results in the following being printed in the terminal from where Firefox was started: JavaScript error: chrome://browser/content/browser.js, line 5566: TypeError: event.stopPropagation is not a function
Component: Event Handling → General
Product: Core → Firefox
(In reply to Olli Pettay [:smaug] from comment #1) > We don't always pass a real event to the function > http://searchfox.org/mozilla-central/rev/ > 9ec085584d7491ddbaf6574d3732c08511709172/browser/modules/ContentClick.jsm#41 There's a trivial wallpaper for the error message here to just remove the event.stopPropagation call at the end of middleMousePaste, but I wonder if we should be calling stopPropagation in the child process here somehow, and I wonder if this means that e10s has more side-effects to middle-click paste than non-e10s has... Mike, do you know? Do we have a tracker for unifying the e10s/non-e10s codepaths here?
Flags: needinfo?(mconley)
(In reply to :Gijs Kruitbosch (PTO recovery mode) from comment #2) > (In reply to Olli Pettay [:smaug] from comment #1) > > We don't always pass a real event to the function > > http://searchfox.org/mozilla-central/rev/ > > 9ec085584d7491ddbaf6574d3732c08511709172/browser/modules/ContentClick.jsm#41 > > There's a trivial wallpaper for the error message here to just remove the > event.stopPropagation call at the end of middleMousePaste Err, I kind of meant stick it in an if: if (typeof event.stopPropagation == "function") { event.stopPropagation(); } but yeah, not sure if that's the right thing to do.
Nothing springs to mind regarding middle-click paste and e10s. Unifying the codepaths is certainly a good idea, though (no bug that I'm familiar with).
Flags: needinfo?(mconley)
Stack: event.stopPropagation is not a function browser.js:5883 middleMousePaste chrome://browser/content/browser.js:5883:3 contentAreaClick resource:///modules/ContentClick.jsm:41:9 receiveMessage resource:///modules/ContentClick.jsm:27:9 receiveMessage jar:file:///usr/lib/firefox/browser/omni.ja!/components/nsBrowserGlue.js:194:15 receiveMessage self-hosted:987:17 This is actually completely blocking the use of middle clicks targeting panels in webextensions.
(In reply to libreme from comment #5) > Stack: > event.stopPropagation is not a function browser.js:5883 > middleMousePaste chrome://browser/content/browser.js:5883:3 > contentAreaClick resource:///modules/ContentClick.jsm:41:9 > receiveMessage resource:///modules/ContentClick.jsm:27:9 > receiveMessage > jar:file:///usr/lib/firefox/browser/omni.ja!/components/nsBrowserGlue.js:194: > 15 > receiveMessage self-hosted:987:17 > > This is actually completely blocking the use of middle clicks targeting > panels in webextensions. Can you clarify what exactly is being "blocked"? Besides the error message, what happens that shouldn't happen, or what fails to happen that should be happening? What steps are you following, given that the STR in comment #0 seem unrelated to panels / webextensions?
Flags: needinfo?(libreme)
@:Gijs I can create a new bug, but this seems related since it's the same error and the discussion mentions code in browser.js. By "blocking" I mean, this bug renders the use or capture of middle click into any panel/popup (browser_action.default_popup in manifest.json of webextension). Steps to reproduce: ================== 1. Install an extension using a panel/popup e.g PrivacyBadger, HTTPS Everywhere, etc. 2. Open the Browser Console (Ctrl+Shift+J) 3. Click on the icon in the toolbar to open a panel Observed behavior ================= - Stack trace as above in Browser console - "onclick" listener/handler in panel isn't triggered (see commit of my extension https://github.com/LoveIsGrief/links-for-later/commit/23f90a1b198eb38b1dddcf5d5d0aff714b01afe4) Expected behavior ================= "onclick" listener isn't triggered
Flags: needinfo?(libreme)
(In reply to Librem Grief from comment #7) > @:Gijs > > I can create a new bug, but this seems related since it's the same error and > the discussion mentions code in browser.js. > > By "blocking" I mean, this bug renders the use or capture of middle click > into any panel/popup (browser_action.default_popup in manifest.json of > webextension). > > Steps to reproduce: > ================== > > 1. Install an extension using a panel/popup e.g PrivacyBadger, HTTPS > Everywhere, etc. > 2. Open the Browser Console (Ctrl+Shift+J) > 3. Click on the icon in the toolbar to open a panel > > Observed behavior > ================= > > - Stack trace as above in Browser console > - "onclick" listener/handler in panel isn't triggered (see commit of my > extension > https://github.com/LoveIsGrief/links-for-later/commit/ > 23f90a1b198eb38b1dddcf5d5d0aff714b01afe4) > > Expected behavior > ================= > > "onclick" listener isn't triggered These steps seem to be missing some details. Are you middle-clicking the icon (which isn't meant to do anything)? Or middle-clicking in the panel (which might be, maybe)? I tested with privacybadger and current nightly on a linux vm, and middle-clicking the 'trackers' link on a page worked, and opened it in a new tab. I thought this might be related to flipping the 'middle click to paste' behaviour on Linux, but flipping the pref back ( middlemouse.contentLoadURL ) to true didn't help me reproducing this issue. Can you clarify? (I tried testing with your add-on but it doesn't work on nightly, for various reasons like being an embedded webextension (not only a webextension), not supporting multi-process, and after fixing those things, it tries to use the SDK loader which we no longer ship on 58...)
Flags: needinfo?(libreme)
Hi, If you launch the addon with jpm, it won't work in the nightly. CDing into the webextensions directory and running it with `web-ext run` worked for me. Ah, I just noticed you might've been trying to run master. The dev branches have the webextension version https://github.com/LoveIsGrief/links-for-later/tree/links-for-later-3 Arg, I forgot other information: $ firefox --version Mozilla Firefox 55.0.2 $ uname -a Linux loneliverse 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial As for reproduction of the issue, indeed I forgot the last step. It was to middle click into the panel. For proof, that I'm not going crazy, please see https://streamable.com/ccry1 On nightly, the onclick event is never reached :/ I'd be happy to prove more information if needed.
Flags: needinfo?(libreme)
(In reply to Librem Grief from comment #9) > Hi, > > If you launch the addon with jpm, it won't work in the nightly. CDing into > the webextensions directory and running it with `web-ext run` worked for me. > Ah, I just noticed you might've been trying to run master. The dev branches > have the webextension version > https://github.com/LoveIsGrief/links-for-later/tree/links-for-later-3 > > Arg, I forgot other information: > $ firefox --version > Mozilla Firefox 55.0.2 > $ uname -a > Linux loneliverse 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC > 2017 x86_64 x86_64 x86_64 GNU/Linux > $ lsb_release -a > No LSB modules are available. > Distributor ID: Ubuntu > Description: Ubuntu 16.04.3 LTS > Release: 16.04 > Codename: xenial > > As for reproduction of the issue, indeed I forgot the last step. It was to > middle click into the panel. > > For proof, that I'm not going crazy, please see https://streamable.com/ccry1 > > On nightly, the onclick event is never reached :/ > > I'd be happy to prove more information if needed. On *current* Nightly, the pref middlemouse.contentLoadURL is `false` by default. Setting it to `true` lets me see the error that is produced in comment #0 and in your steps, but it does not happen if the pref is at its default (false) value. The click doesn't do anything either way. I think you're running into a separate bug that probably wants filing with the webextension folks.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.