Is there a way to programmatically select frame context with Javascript? Let's say there are two different frames present in the current web page, and I need to append 'hello' to the second frame. The problem is that the second frame has a different domain than the current web page. With chrome developer tools, I can simply choose the second frame context and do $('body').append('hello')
from console, but I should be able to do this programatically.
Reference: Debugging iframes with Chrome developer tools
Is there a way to achieve this?
intention: I need to create a bookmarklet that specifically targets the frame that has a different domain than the main webpage.