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

Object.assign() Fix #632

Merged
merged 3 commits into from
Dec 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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