Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #632 from BarakaAka1Only/master
Browse files Browse the repository at this point in the history
Object.assign() Fix
  • Loading branch information
jacobwgillespie authored Dec 19, 2016
2 parents 0e23f50 + c1b4679 commit a5cf704
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions radiant-player-mac/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,8 @@ - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
// Only apply the main script file when the player is ready.
if ([[webView mainFrameDocument] querySelector:@"#playerSongInfo"]) {
/* Recent update Object.assign() returns undefined making a lot of the functionality broken adding a Polyfill should fix this */
[webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"if(Object.assign == undefined){Object.defineProperty(Object,\"assign\",{enumerable:!1,configurable:!0,writable:!0,value:function(a){\"use strict\";if(void 0===a||null===a)throw new TypeError(\"Cannot convert first argument to object\");for(var b=Object(a),c=1;c<arguments.length;c++){var d=arguments[c];if(void 0!==d&&null!==d){d=Object(d);for(var e=Object.keys(Object(d)),f=0,g=e.length;f<g;f++){var h=e[f],i=Object.getOwnPropertyDescriptor(d,h);void 0!==i&&i.enumerable&&(b[h]=d[h])}}}return b}})};"]];
[self evaluateJavaScriptFile:@"gmusic"];
[self evaluateJavaScriptFile:@"main"];
}
Expand Down

0 comments on commit a5cf704

Please sign in to comment.