简体   繁体   English

删除由iframe小部件提供支持的功能-不显示任何内容,css不起作用

[英]Remove powered by in iframe widget - display none and css not work

I have a website and added a chat widget but want to display none on some part of this widget/iframe. 我有一个网站,并添加了一个聊天小部件,但希望在此小部件/ iframe的某些部分不显示任何内容。 The widget is loaded in an iframe with .js file and HTML trigger. 该小部件已加载到带有.js文件和HTML触发器的iframe中。

I can in Chrome Developer Tools use this code to get away the things I want but I can not get this to work on the live site. 我可以在Chrome开发者工具中使用此代码来摆脱我想要的东西,但无法在实际网站上使用它。

.ember-view .footer-note {
    display: none!important;
}

HERE IS CODE I WANT TO DISPLAY NONE 这里是代码,我不想显示

<div id="ember123" class="ember-view footer-note">⚡ by <a href="https://somelink.com/" class="product" target="_blank">the link</a>
</div>

How do I do to load my CSS code after maby 5 secounds after all page have been loaded? 加载所有页面后,maby 5秒后如何加载CSS代码?

I have tested this but doesn't work: 我已经测试过了,但是不起作用:

$(window).load(function() {
$('head').append('<link rel="stylesheet" type="text/css" href="//www.linktoCSSwhereDisplayNoneIs.se/css/style.css">');
});

$('iframe').contents().find("div[comp='ember*']").remove();

And the css 和CSS

*[id^='ember-']{
display: none!important;
}
div[class^="ember"], div[class*=" ember"] {
    color:red 
}
.ember-view .footer-note {
    display: none!important;
}

Probably we can try appending the style after the iframe has loaded. 可能我们可以尝试在iframe加载后附加样式。

$("#iframe-id").on("load", function () {
    $('head').append('<link rel="stylesheet" type="text/css" href="//www.linktoCSSwhereDisplayNoneIs.se/css/style.css">');
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM