6

In Winter 16 create simple onclick js custom button with code below (REQUIRESCRIPT below is not required for code execution, it's just for demonstrating steps to reproduce):

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
// some possible code that uses connection.js or just nothing
var w = window.open('https://salesforce.com');

Make sure you have no exceptions added to browser for popup opening from your testing SF instance (e.g. Chrome --> Settings -> Privacy -> Content settings... -> Pop-ups -> Manage Exceptions...).

enter image description here

check the list after clicking "Manage Exceptions" button

enter image description here

When you click button with sample code first time (e.g. in Chrome) you will see "Pop-up blocked" message. When you click button for the second time - popup opens.

enter image description here

This opens after first click in Summer 15.

This will open after first click even in Winter 16 if you remove REQUIRESCRIPT line from sample code and just leave window.open line.

I know there are changes to behavior of REQUIRESCRIPT function in Winter 16...

REQUIRESCRIPT No Longer Executes JavaScript On Page Load

We’ve changed the way custom JavaScript buttons and links work when they use REQUIRESCRIPT. The REQUIRESCRIPT resources aren’t included in the page until the user clicks the custom JavaScript button or link.

... but why does this change affect scenario above?

Anyone faced with this behavior? Any ideas?

closed as off-topic by Adrian Larson, Vigneshwaran G, Ratan Paul, Eric, Lance Shi Nov 12 '16 at 5:17

  • This question does not appear to be about Salesforce within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Are you sure you don't have any pop-up blocker installed? Can you test it in incognito mode in chrome with all extensions disabled? – manjit5190 Oct 1 '15 at 17:23
  • 1
    yep, I can reproduce it in incognito mode. Moreover I can reproduce it in IE 11 and latest version of Firefox – Victor Oct 1 '15 at 18:40
  • 4
    I'm voting to close this question as off-topic because it appears to be abandoned. – Adrian Larson Nov 11 '16 at 14:02
  • @AdrianLarson I don't see where this was 'abandoned'. Like many questions, it appears to me that it simply couldn't be resolved and was instead verified in Rao's answer below as being a problem. I see no reason to close it. – crmprogdev Nov 11 '16 at 14:43
0

Update screen shot of Pop up exceptions

*I had some exceptions once I cleared them, I am getting pop up and as you pointed its opening the next time *

enter image description here

enter image description here

enter image description here

  • Hi Rao, 1) please, check you have no exceptions added to browser for instance you checking. In Chrome -> Settings -> Privacy -> Content settings... -> Pop-ups -> Manage Exceptions... 2) What instance are you using - gs0? What is the purpose of instances like "gs"? I'm not sure it's the right instance to check since you can't be sure you have real Winter 16 (which version and patch?) there - at least I can't locate instances like "gs" here trust.salesforce.com/trust/instances. – Victor Oct 1 '15 at 17:10
  • @Victor I am on a developer account and salesforce has spun up this instance , I will test it in a sandbox and see what the results are. I do not see any pop ups – Rao Oct 1 '15 at 17:12
  • do you mean it's not opening? – Victor Oct 1 '15 at 17:17
  • check my update, I tested in cs20 instance and it works fine. Do you not see a new window open up (or) do you see errors in console? – Rao Oct 1 '15 at 17:21
  • 2
    Thanks for confirming. If you test it on Summer 15 instance or just remove "REQUIRESCRIPT" line in Winter 16 - it works fine from first click. So, it's definitely related to REQUIRESCRIPT in WInter 16. Rather strange behavior and I don't see how we can workaround it except clicking twice or adding exception to browser. – Victor Oct 1 '15 at 18:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.