Authored by yyq

del unuse

export default [{
name: 'iframe',
path: '/xianyu/iframe',
component: () => import(/* webpackChunkName: "iframe" */ './page')
}];
<template>
<LayoutApp :title="title">
<iframe ref="iframe" :onload="onload()" :src="url" class="page"></iframe>
</LayoutApp>
</template>
<script>
export default {
name: "IframePage",
data() {
return {
show: false,
title: '',
// url: 'https://www.baidu.com',
url: 'http://activity.yoho.cn/feature/6823.html?title=一键领取680元神劵&nodownload=1'
};
},
mounted() {
this.show = true;
},
methods: {
onload() {
setTimeout(() => {
this.loadPage();
}, 100)
},
loadPage() {
console.log('onload');
console.log({...this.$refs});
if (!this.$refs.iframe) {
return;
}
const elemIfram = this.$refs.iframe;
const contentWindow = elemIfram.contentWindow;
// const iframeDocument = contentWindow.document;
console.log(contentWindow)
if (contentWindow.MutationObserver || contentWindow.webkitMutationObserver) {
console.log(11)
let observer;
// chrome
let callback = function(mutations) {
mutations.forEach(function(mutation) {
console.log(mutation.oldValue, mutation.target.src, mutation.target);
});
};
if (contentWindow.MutationObserver) {
observer = new MutationObserver(callback);
} else {
observer = new webkitMutationObserver(callback);
}
observer.observe(elemIfram, {
attributes: true,
attributeOldValue: true
});
} else if (elemIfram.addEventListener) {
console.log(22)
// Firefox, Opera and Safari
elemIfram.addEventListener("DOMAttrModified", function(event){
console.log(event.prevValue,event.newValue,event.target);
}, false);
}
// console.log(iframeDocument.getElementsByTagName('a'));
}
}
};
</script>
<style lang="scss" scoped>
.page {
width: 100%;
height: 100%;
position: absolute;
top: 0;
bottom: 0;
}
</style>
... ... @@ -10,9 +10,9 @@ const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test3';
const domains = {
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
ufo: 'http://2.yohobuy.com',
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// ufo: 'http://2.yohobuy.com',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/',
... ... @@ -23,9 +23,9 @@ const domains = {
// platformApi: 'http://172.16.6.210:8088/',
// api: 'http://api-test3.dev.yohocorp.com/',
// service: 'http://api-test3.dev.yohocorp.com/',
// ufo: 'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/',
api: 'http://api-test3.dev.yohocorp.com/',
service: 'http://api-test3.dev.yohocorp.com/',
ufo: 'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/',
};
module.exports = {
... ... @@ -33,11 +33,11 @@ module.exports = {
appVersion: '6.9.12', // 调用api的版本
appName: 'xianyu-ufo-app-node',
port: 6001,
siteUrl: '//m.yohobuy.com',
siteUrl: '//xianyu.yohobuy.com',
assetUrl: '//m.yohobuy.com:5001/yohoapp-node/',
testCode: 'yoho4946abcdef#$%&!@',
domains,
yohoVerifyUdid: 'ca5c462a-e28b-407d-8061-5e204398e3cc',
// yohoVerifyUdid: 'ca5c462a-e28b-407d-8061-5e204398e3cc',
signExtend: {
business_line: 'yohobuy',
business_client: 'h5/xianyu',
... ...