0

I want to remove a class inside of an iframe with javascript. The code is here:

<iframe width="456" height="940" src="//invis.io/exampleabcde" frameborder="0" allowfullscreen></iframe>

once the html loads this is displayed in the developer console:

<div ng-include=" '/assets/apps/share/views/powered-by/powered-by.htm' " class="ng-scope">
<!-- Hide this object for all Shopify Enterprise project shares. ( companyID 71 ).  Everyone else should see it. -->
<div ng-controller="poweredBy.poweredByController" ng mouseenter="announceActivityChange(true)" ng-mouseleave="announceActivityChange(false)" ng-hide="project.companyID == 71" class="ng-scope">
<!-- BEGIN: Powered By Tag -->
<!-- ngIf: ! project.isMobile || share.isEmbed --><a ng-if=" ! project.isMobile || share.isEmbed " class="powered-by ng-scope active" ng-class="{ 'active': isActive }" href="http://www.invisionapp.com/?utm_medium=virality&amp;utm_source=Share%20CTA" target="_blank">
<img src="/assets/apps/share/img/logo-icon.png">
</a><!-- end ngIf: ! project.isMobile || share.isEmbed -->
<!-- END: Powered By Tag -->
</div>
</div>

The actual code I listed above is not so important, the key take away is that the iframe loads with some angularjs and I'm not able to access the specific class I want and delete it.

When I delete the line of code class="powered-by ng-scope active" in the developer console it removes what I want perfectly. However I can't seem to execute code to remove this class in javascript. I've tried $(".powered-by").remove(); and several other methods, but nothing has been able to remove this class.

Any help into removing iframe classes would be greatly appreciated. Thanks.

`

Troy Griffiths
  • 351
  • 2
  • 7
  • 17

1 Answers1

2

You can't get access to content of an iframe, if the iframe is not on the same domain as your page, due to the same-origin policy

Matt
  • 74,352
  • 26
  • 153
  • 180
Igor Adamenko
  • 861
  • 1
  • 8
  • 20