Commit 63141321 authored by 周成's avatar 周成 🇨🇳

alert去掉域名显示

parent 3da03169
......@@ -441,6 +441,23 @@ export default class CustomSceneBase extends Scene {
async onTap_playBtn(e?: egret.Event) {
if (window.location.href.match(/preview=1/)) {
window.alert = function(name){
var iframe = document.createElement("IFRAME");
iframe.style.display="none";
document.documentElement.appendChild(iframe);
window.frames[0].window.alert(name);
iframe.parentNode.removeChild(iframe)
}
window.confirm = function (message) {
var iframe = document.createElement("IFRAME");
iframe.style.display = "none";
iframe.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe);
var alertFrame = window.frames[0];
var result = alertFrame.window.confirm(message);
iframe.parentNode.removeChild(iframe);
return result;
}
alert('试玩不支持抽奖,分享后即可抽奖')
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment