async function emsFetch(url , param){
try {
var _param = '';
if(param){
_param = param;
}
var response = await fetch(url + '?' + _param);
const resText = await response.text();
return resText;
} catch (error) {
console.log('Ems Fetch Error:' + url);
}
}
(async function(){
let current_Script = document.currentScript;
// jQueryを呼ぶ
if(typeof $ems === 'undefined'){
const jQueryTemp = await emsFetch('https://www21.easy-myshop.jp/ems/js/jquery-2.2.4.min.js');
eval(jQueryTemp);
$ems = $.noConflict(true);
}
(function($){
if(document.querySelectorAll ){
var protocol = window.location.protocol;
if(protocol.indexOf('https:') && protocol.indexOf('http:')){
// ローカル環境での発火 エラーメッセージを出す
current_Script.insertAdjacentHTML('afterend','
JSカートタグエラー。(ローカル環境では使用できません)
');
// 展開せずに終了
return;
}
var domain = document.domain;
var security = false;
if(domain == 'cafefox.jp'){
security = true;
}else{
var astHost = '.' + 'cafefox.jp';
if(domain.endsWith(astHost)){
security = true;
}
}
if(domain == 'cafefox.easy-myshop.jp'){
security = true;
}else{
var astHost = '.' + 'cafefox.easy-myshop.jp';
if(domain.endsWith(astHost)){
security = true;
}
}
if(!security){
current_Script.insertAdjacentHTML('afterend','このドメインページでは貼り付けを許可されていません。
');
return;
}
// JSカート展開
var html = '';
html += '';
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
current_Script.insertAdjacentHTML('afterend',html);
const scriptJs = emsFetch('https://cafefox.easy-myshop.jp/c-cart-mapping.js?pre=0');
scriptJs.then(res => {
eval(res);
}).catch(err => {});
}else{
//SelectorsAPI Non Support
}
function __preAlt(){
var flg = true;
return flg;
}
}($ems));
})();