/    Sign up×
Community /Pin to ProfileBookmark

Soundcloud window.opener problem

I’m having problems with a clients website, this code is working fine for windows computers but not on mac.
I have used a VM on browserstack for multiple versions of osx and they all work fine but on 3 of my friends macbooks it doesn’t – the window just doesnt close.

>

callback.html

[code=html]
<!DOCTYPE html>
<html lang=”en”>
<head><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<title>Connect with SoundCloud</title>
</head>
<body>
<b style=”width: 100%; text-align: center;”>This popup should automatically close in a few seconds</b>
<script type=”text/javascript”>
function myFunction() {

parent.window.setTimeout(parent.window.opener.SC.connectCallback, 1);
}
</script>
<button onclick=”myFunction()”>Close window</button>
</body>
</html>[/code]

The soundcloud api works perfectly for me but nobody else.
Can anyone please help?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@rootFeb 22.2016 — You have a 1 millisecond call back, in leymans, your call back triggers instantly.

Also, you use setTimeout( callback_function, delay_in_milliseconds ); to set a time out callback.
Copy linkTweet thisAlerts:
@TrenchauthorFeb 22.2016 — You have a 1 millisecond call back, in leymans, your call back triggers instantly.

Also, you use setTimeout( callback_function, delay_in_milliseconds ); to set a time out callback.[/QUOTE]


Surely the delay shouldn't make it incompatible with macs (making it not close the window) though?

Also thanks for the reply!
Copy linkTweet thisAlerts:
@rootFeb 22.2016 — People have pop up blockers or settings to stop popup windows, which is why developers have problems...
×

Success!

Help @Trench spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...