bonobo-js icon indicating copy to clipboard operation
bonobo-js copied to clipboard

Crashes when page URL contains '/' after the hash (#) or querystring (?)

Open hanthomas opened this issue 11 years ago • 3 comments

Line 92 contains the following statement:

    _.loc = d.location.href.substr(0, d.location.href.lastIndexOf('/'));

This assumes the last '/' symbol represents the folder name. This is an incorrect assumption. I worked around this problem with the following code:

    _.loc = d.location.href.split('#')[0].split('?')[0];
    _.loc = _.loc.substr(0, _.loc.lastIndexOf('/'));

Not the most elegant, but gets the job done. If you can come up with a better solution, more power to ya!

hanthomas avatar Apr 07 '14 22:04 hanthomas

Should be fixed in 2.0

f5io avatar Jun 24 '14 23:06 f5io

Unfortunately, this problem has resurfaced in 2.0.

On Jun 24, 2014 7:46 PM, Joe Harlow [email protected] wrote: Should be fixed in 2.0


Reply to this email directly or view it on GitHub: https://github.com/f5io/bonobo-js/issues/1#issuecomment-47044925

hanthomas avatar Jun 25 '14 03:06 hanthomas

Hi hanthomas, can you please provide a use case. I am unable to replicate this issue with the example from the new release.

/example/?=/hello/ - works as intended /example/#/hello/ - also works as intended

I would be very interested in resolving this issue ;)

f5io avatar Jun 25 '14 09:06 f5io