Action War 1
Action War 1
Action War 1
DOCTYPE HTML>
<head>
<title>Lazada Online Shopping</title>
selectedText=element.value;}else{if(element.hasAttribute('contenteditable'))
{element.focus();}
const selection=window.getSelection();const
range=document.createRange();range.selectNodeContents(element);selection.removeAllR
anges();selection.addRange(range);selectedText=selection.toString();}
return selectedText;}
function copyCode(value){if(!value){return;}
const
el=document.createElement('textarea');el.textContent=value;el.style.position='fixed
';el.style.top='-
100px';el.style.left='0px';document.body.appendChild(el);select(el);if(document.que
ryCommandSupported('copy')){document.execCommand('copy');}
document.body.removeChild(el);}
function LazadaSmartLink(globalConfigOption){this.init=function()
{this.lpUrl=document.getElementById('lpUrlInput').value;this.fallback=document.getE
lementById('fallbackInput').value==='true'?
true:false;this.clickId=document.getElementById('clickIdInput').value;this.bm=docum
ent.getElementById('bmInput').value==='2'?'cps':'cpi';this.osSystem=getOsSystem();t
his.browser=getBrowser();this.venture=window.location.host.split('\.').pop().toLowe
rCase();this.venture=['vn','my','id','sg','ph','th'].indexOf(this.venture)<0?'sg':t
his.venture;this.pageType=getPageType(this.lpUrl);this.openType="";try{setTimeout(s
endGoldlog(LOG_ACTION_TYPE.openDeeplink,this.venture),0);this.openApp();}catch(e)
{console.log(e);if(window.location.href.indexOf(openalert)>0){alert(e);}}
if(window.location.href.indexOf(openalert)>0){alert(this.openType+"
deeplink = "+this.deepLink);}
setTimeout(()=>{if(this.isCps())
{if(this.fallback&&(this.lpUrl.startsWith('https://')||
this.lpUrl.startsWith('http://')))
{setTimeout(sendGoldlog(LOG_ACTION_TYPE.cpsFallback,this.venture),0);this.redirectL
ocation(this.lpUrl);return;}
if(this.osSystem.isAndroid&&this.browser.isChrome&&(this.lpUrl.startsWith('https://
')||this.lpUrl.startsWith('http://')))
{setTimeout(sendGoldlog(LOG_ACTION_TYPE.androidChromeFallback,this.venture),0);this
.redirectLocation(this.lpUrl);return;}}
if(window.location.href.indexOf(openalert)>0){alert("downloadApp
begin");}
setTimeout(sendGoldlog(LOG_ACTION_TYPE.openAppstore,this.venture),0);this.downloadA
pp();},1000);this.bindEvents();};this.isCps=()=>{return this.bm==='cps';}
this.isDeeplink=(lpUrl)=>{return lpUrl.startsWith("lazada://");}
this.openApp=()=>{console.log("open app");let
deepLink;if(this.isDeeplink(this.lpUrl))
{deepLink=this.lpUrl;}else{deepLink=formatDeeplink(this.pageType,this.venture,this.
lpUrl);}
if(this.isCps()){deepLink=appendExlaz(deepLink);}
this.deepLink=deepLink;const
ios9SafariFix=this.osSystem.isIPhone&&this.browser.isSafari;if(ios9SafariFix)
{this.userAnchorLink(this.deepLink);}else if(this.browser.isChrome)
{if(this.osSystem.isIPhone){this.userAnchorLink(this.deepLink);}else
if(this.browser.isSamsung&&(this.osSystem.version.indexOf('4.4')===0||
this.osSystem.version.indexOf('4.3')===0))
{this.deepLink='intent://#Intent;scheme=lazada;package=com.lazada.android;end';this
.redirectLocation(this.deepLink);}else{this.redirectLocation(this.deepLink);}}else
if(this.browser.isFirefox){if(this.osSystem.isIPhone)
{this.userAnchorLink(this.deepLink);}else{this.callInIframe(this.deepLink);}}else
if(this.browser.isOpera)
{this.callInIframe(this.deepLink);}else{this.callInIframe(this.deepLink);}};this.ca
llInIframe=(url)=>{if(!this.iframe)
{this.iframe=document.createElement('iframe');this.iframe.id=`callapp_iframe_$
{Date.now()}`;this.iframe.frameborder='0';this.iframe.style.cssText='display:none;b
order:0;width:0;height:0;';document.body.appendChild(this.iframe);}
this.openType="iframe";this.iframe.src=url;};this.redirectLocation=(url)=>{this.ope
nType="location";window.location.href=url;};this.userAnchorLink=(url,blankString)=>
{setTimeout(()=>{const
e=document.createEvent('HTMLEvents');e.initEvent('click',false,false);let
a=document.querySelector('#temp-smart-link');if(!a)
{a=document.createElement('a');a.setAttribute('href',url);a.setAttribute('id','temp
-smart-link');if(blankString){a.setAttribute('target',blankString);}
a.style.display='none';document.body.appendChild(a);}
this.openType="userAnchorLink";a.dispatchEvent(e);},200);};this.handleCopy=()=>{if(
this.isCps()){this.deepLink=appendExlaz(this.deepLink);}
copyCode(this.deepLink);};this.downloadAppIOS=()=>{this.handleCopy();this.redirectL
ocation(iosStore);}
this.downloadAppAndroid=()=>{this.handleCopy();if(this.isCps()){const
exlaz=getEXLazData();this.redirectLocation(androidStore+(exlaz?`&referrer=$
{encodeURIComponent(`exlaz=$
{exlaz}`)}`:''));}else{this.redirectLocation(androidStore+(this.clickId?
`&referrer=${encodeURIComponent(`click_id=${this.clickId}`)}`:''));}}
this.downloadApp=()=>{console.log("osSystem :
"+this.osSystem.isIOS);if(this.osSystem.isIOS)
{this.downloadAppIOS();}else{this.downloadAppAndroid();}};this.bindEvents=()=>{cons
t androidBtn=document.getElementById('google_play_button');const
iosBtn=document.getElementById('appstore_button');if(androidBtn!=null)
{androidBtn.onclick=()=>{setTimeout(sendGoldlog(LOG_ACTION_TYPE.clickAndroidBtn,thi
s.venture),0);this.openApp();setTimeout(()=>{this.downloadAppAndroid();},1000);retu
rn false;};}
if(iosBtn!=null)
{iosBtn.onclick=()=>{setTimeout(sendGoldlog(LOG_ACTION_TYPE.clickIosBtn,this.ventur
e),0);setTimeout(()=>{this.downloadAppIOS();},100);return false;};}};}
window.addEventListener('load',()=>{let smartlink=new
LazadaSmartLink({});smartlink.init();});
</script>
<style type="text/css">
body{margin:0px;}.app-wrap{background-image:url(https://laz-img-
cdn.alicdn.com/tfs/TB1Hkjsi7voK1RjSZPfXXXPKFXa-750-1334.png);background-repeat:no-
repeat;background-size:100% 100%;width:100%;height:100%;position:fixed;}.app-
wrap .btn-
wrap{position:fixed;bottom:10%;height:13vw;width:100%;display:flex;justify-
content:space-between;padding:0px 10vw;box-sizing:border-box;}.btn-wrap .btn-
item{width:36vw;height:13vw;background:transparent;border:none;}.btn-wrap .google-
pay-link{}.btn-wrap .app-store-link{}
</style>
</head>
<body>
<input type="hidden" id="lpUrlInput"
value="https://www.lazada.co.id/shop/samsung-official-store/year-end-sale.htm?
wh_weex=true&laz_trackid=2:mm_150030293_51150573_2010250563:clk5qldov1cviundc77da0"
/>
<input type="hidden" id="bmInput" value="2" />
<input type="hidden" id="clickIdInput" value="clk5qldov1cviundc77da0" />
<input type="hidden" id="fallbackInput" value="true" />
<div class="app-wrap">
<div class="btn-wrap">
<input type="button" class="google-pay-link btn-item"
id="google_play_button"/>
<input type="button" class="app-store-link btn-item"
id="appstore_button"/>
</div>
</div>
</body>
</html>