Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

the link with the right mouse button in firefox #7984

Closed
krom-xr opened this issue Jun 25, 2014 · 15 comments
Closed

the link with the right mouse button in firefox #7984

krom-xr opened this issue Jun 25, 2014 · 15 comments

Comments

@krom-xr
Copy link
Contributor

krom-xr commented Jun 25, 2014

When i click right mouse button on link with hash in firefox. Brower goes to link url.
This bug occurs when I use $location as param in run function

See jsfiddle http://jsfiddle.net/kromxr/76fKM/12/

angular-version - any
browser - firefox 30.0
os - OS X 10.9.3

@krom-xr
Copy link
Contributor Author

krom-xr commented Jun 25, 2014

i think the bug is here

$rootElement.on('click', function(event) {
// TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
// currently we open nice url link and redirect then

  if (event.ctrlKey || event.metaKey || event.which == 2) return;

...
May be this code can fix the problem?

  if (event.ctrlKey || event.metaKey || event.which == 2 || event.button == 2) return;

@petebacondarwin
Copy link
Contributor

@krom-xr - this seems like a valid issue. Would you like to make a pull request with this fix containing a unit test that demonstrates the problem? See https://github.com/angular/angular.js/blob/master/test/ng/locationSpec.js#L1139

@petebacondarwin petebacondarwin added this to the Backlog milestone Jun 27, 2014
@krom-xr
Copy link
Contributor Author

krom-xr commented Jun 27, 2014

I will try

krom-xr added a commit to krom-xr/angular.js that referenced this issue Jun 28, 2014
When user click right mouse button on links in firefox, browser goes to
link. See http://jsfiddle.net/kromxr/76fKM/12/

Closes angular#7984
rodyhaddad pushed a commit to rodyhaddad/angular.js that referenced this issue Jun 29, 2014
When user click right mouse button on links in firefox, browser goes to
link. See http://jsfiddle.net/kromxr/76fKM/12/

Closes angular#7984
rodyhaddad pushed a commit to rodyhaddad/angular.js that referenced this issue Jun 29, 2014
When user click right mouse button on links in firefox, browser goes to
link. See http://jsfiddle.net/kromxr/76fKM/12/

Closes angular#7984
@Narretz
Copy link
Contributor

Narretz commented Jul 11, 2014

This seems to be the same bug as in #2668

@rochajesus
Copy link

krom-xr, I tried using the recommended fix to patch my local angular-1.2.13.js but it did not resolve the problem.

@krom-xr
Copy link
Contributor Author

krom-xr commented Aug 7, 2014

Browser? OS?

@rochajesus
Copy link

OSX 10.9.4, FF 30

It works now. Had a weird experience using default firefox debugger, 'Show Original Sources' was checked and caused the non-minified file to show up when in fact the minified one was being included. When I switched the include to the non-minified file where I applied the changes it worked.

Do you have any recommendations on the best way to go about applying this patch before the fix is released? Modifying the core framework file doesn't sounds like an ideal fix. Any other advice appreciated.

@krom-xr
Copy link
Contributor Author

krom-xr commented Aug 8, 2014

I use the following hack

$(document).on('click', function(e) {
    if (e.button === 2) {
        e.stopPropagation();
        e.preventDefault();
     }
}); 

@caitp
Copy link
Contributor

caitp commented Aug 8, 2014

honestly there isn't going to be an elegant solution for this until browsers implement role-based UIEvents (spec is in progress), so that we are only concerned with the navigation role (and not context menus etc). Otherwise it can break depending on browser and system configuration, and just generally sucks

@caitp
Copy link
Contributor

caitp commented Aug 8, 2014

DOM3 has helped a bit with this, but it's far from perfect, unfortunately, and browser support is limited

@krom-xr
Copy link
Contributor Author

krom-xr commented Aug 8, 2014

Of course I see this as a temporary solution

@btford btford removed the gh: issue label Aug 20, 2014
krom-xr added a commit to krom-xr/angular.js that referenced this issue Dec 11, 2014
When user click right mouse button on links in firefox, browser goes to
link. See http://jsfiddle.net/kromxr/76fKM/12/

Closes angular#7984

Conflicts:
	src/ng/location.js
	test/ng/locationSpec.js
@BrianMcBrayer
Copy link

So... what are the chances that this will make it into 1.3? Our enterprise product is not yet ready to be 1.4-enabled, and this is currently a bug. I can back-patch it, but I'd prefer instead to get it from an official repo.

Thanks!

@Narretz
Copy link
Contributor

Narretz commented Feb 20, 2015

@BrianMcBrayer have you checked out 1.3.13? It looks like the code is in: https://github.com/angular/angular.js/blob/v1.3.13/src/ng/location.js Maybe it didn't make it to the changelog?

@BrianMcBrayer
Copy link

You're right. It wasn't in the changelog--didn't think of looking at the source. Everything's peachey! :)

@petebacondarwin
Copy link
Contributor

It didn't get officially backported but then sneaked in as part of this commit...

939ca37

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.