Ask Your Question
2

Social sharing buttons javascript bug

asked 2011-11-15 05:20:57 -0500

alexwerner gravatar image

updated 2011-11-16 16:05:58 -0500

Steps to reproduce:

  • Disallow PopUps in your browser
  • Click on any of the social sharing buttons next to a question, except google+

Expected result:

  • The sharing page opens in the current window/tab

Actual result:

  • No page opens
  • Javascript error log:

ReferenceError: Can't find variable: share_url in post.js:1573

Versions affected:

  • 0.7.22 - 0.7.29
  • Skins old and default
edit retag flag offensive close merge delete

Comments

I did not see the error in the console, but obviously if you block the pop-ups - they won't open. Current implementation uses pop-up windows - so it is perhaps a misfeature. A js-popup would be nicer, we'll look into that.

Evgeny gravatar imageEvgeny ( 2011-11-15 08:00:28 -0500 )edit

Just looked at post.js myself: If you change the name of share_url to url, the sharing page opens in the current window if the popup cannot be opened.

alexwerner gravatar imagealexwerner ( 2011-11-15 08:11:17 -0500 )edit

Hmm, did not think of that, I am not sure I like that a whole page from another site will take entire screen. I really prefer a js popup.

Evgeny gravatar imageEvgeny ( 2011-11-15 08:24:13 -0500 )edit

Yes, a popup is indeed preferable... perhaps informing the user that the popup could not be opened, as clicking on the sharing buttons and nothing happens is bad behavior, I think.

alexwerner gravatar imagealexwerner ( 2011-11-15 08:27:35 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2011-11-15 08:52:46 -0500

Evgeny gravatar image

Tried a quick iframe in a js pop-up implementation - does not work for facebook.

Turns out there is an HTTP header that you can use to forbid displaying your site in iframes - which apparently facebook does - so apparently the only options are: pop up window and replace the view in the current window.

Would be nice to be able to detect when pop-ups are blocked and then go for the second option as a fallback.

edit flag offensive delete link more

Comments

After looking at post.js a bit more it seems as the fallback is already implemented, but buggy: If the pop up window fails, it is tried to open the link in the current window, but the wrong variable is used.

alexwerner gravatar imagealexwerner ( 2011-11-15 09:05:50 -0500 )edit

After looking at post.js a bit more it seems as the fallback is already implemented, but buggy: If the pop up window fails, it is tried to open the link in the current window, but the wrong variable is used.

alexwerner gravatar imagealexwerner ( 2011-11-15 09:05:51 -0500 )edit
0

answered 2011-11-16 16:04:54 -0500

alexwerner gravatar image

Detection of blocked pop-ups and fallback to open the link in the current window is now fixed in https://github.com/ASKBOT/askbot-devel/commit/d39849bc2e73d1c9cdcb07b12fe6fdf6d562e582">git.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-11-15 05:20:57 -0500

Seen: 177 times

Last updated: Nov 16 '11