embed.js target_origin more short code

Co-authored-by: AHOHNMYC <24810600+AHOHNMYC@users.noreply.github.com>
This commit is contained in:
bonjinnorenka 2023-08-29 07:51:48 +09:00 committed by GitHub
parent e9faeb793b
commit 024246d1b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,10 +81,7 @@ function return_message(message,target_window){
additional_info['value'] = {geterrorcode:player.error().code};
}
message = Object.assign(additional_info,message);
let target_origin = url_params.get('origin');
if(target_origin===null){
target_origin = '*';
}
let target_origin = url_params.get('origin') || '*';
target_window.postMessage(message,target_origin);
}