×

Give a tip

[WinPC Confirmed] Bookmarklets with " Character Broken in 4.9.x


Secret-HQ

Recommended Posts

As mentioned in a post about 4.9.0.2200, the Diigo bookmarklet is broken in Maxthon 4.9.x.

Quotation marks in the URL seem to be the problem, suggesting that the new Favorites system in 4.9 isn't escaping them properly (or isn't reading escaped ones properly, at least).  Manually escaping the " characters with %22 works to get around the issue.

Here's a video illustrating the bug:  https://youtu.be/0a7tagrVI_I

Tip   Give
Link to comment
Share on other sites

Hmmm — the release thread for 4.9.0.2700 seems to indicate this has been fixed, listing two related bug IDs:

  • MX5BUG-1052  Favorites with “ has been destroyed
  • MX5BUG-1051  Favorites _ URL does not support double quotes

... but it doesn't appear to be fixed for me.

I haven't tried the portable or a clean install yet, but I'm testing against this URL for Diigo.com's "Diigolet" bookmarklet, which you can add and test yourself:

javascript:(function(){s=document.createElement("script");s.type="text/javascript";s.src="https://www.diigo.com/javascripts/webtoolbar/diigolet_b_h_b.js";document.body.appendChild(s);})();

Can anyone else confirm or deny?

Tip   Give
Link to comment
Share on other sites

1 hour ago, Secret-HQ said:

Hmmm — the release thread for 4.9.0.2700 seems to indicate this has been fixed, listing two related bug IDs:

  • MX5BUG-1052  Favorites with “ has been destroyed
  • MX5BUG-1051  Favorites _ URL does not support double quotes

... but it doesn't appear to be fixed for me.

I haven't tried the portable or a clean install yet, but I'm testing against this URL for Diigo.com's "Diigolet" bookmarklet, which you can add and test yourself:

javascript:(function(){s=document.createElement("script");s.type="text/javascript";s.src="https://www.diigo.com/javascripts/webtoolbar/diigolet_b_h_b.js";document.body.appendChild(s);})();

Can anyone else confirm or deny?

Try this instead:

javascript:(function(){s=document.createElement('script');s.type="text/javascript";s.src="https://www.diigo.com/javascripts/webtoolbar/diigolet_b_h_b.js";document.body.appendChild(s);})();

It's not that I know much about js, but there are scripts I have installed for the Bing bookmarklet.  I compared them.  Double-quotes don't seem work in the variable declaration s=document.createElement('script').  This takes me to a blank page with a bar at the top-right to login or create a Diigo account.

This might be a workaround if both single and double quotes should be recognized.  I just don't know if that is so.

                        <<SL>>

 

 

Tip   Give
Link to comment
Share on other sites

2 minutes ago, SnowLeopard said:

Double-quotes don't seem work in the document.createElement('script')  part.  This takes me to a blank page with a bar at the top-right to login or create a Diigo account.

Thanks, @SnowLeopard.  That's actually the intended behavior.  (If you're logged in, you get a toolbar of bookmarking tools.  If not, you get prompted to log in or open an account.)

Replacing all the double quotes with single quotes works for me — though just replacing the ones in createElement only means that Maxthon goes a little further down the string before it hits a double quote and believes it's reached the end of the Favorite URL.  Now that you mention it, it is a little unusual for createElement to have double quotes rather than single quotes.  In my experience with JavaScript, strings inside double quotes are usually variables or other elements that are going to be parsed, whereas elements in single quotes are treated as literal strings (as you'd expect script to be).  But that's the way I got it from Diigo, and that's the way I've been using it, so ...  :top:

Nice to know there are two viable workarounds, though:

  1. Replace " with %22; or
  2. replace " with '.
Tip   Give
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.