0

Some years ago, I built in my CMS a customisable twitter widget, for embedded use in web pages. This stopped working since twitter yanked out support last week.

The new timeline widget misses the autoscroll option, but I can live with that.

But it sadly creates several cascading iframes (iframe><iframe></iframe></iframe>), so I need a method to tweak font sizes, colors etcetera in the iframes created by twitter.
so far I have come up with this:

function tweakstyle() {
    var iframe = top.frames[0].frames[0].document; // this is the line that generates the cross domain error
    var otherhead = iframe.getElementsByTagName("head")[0];
    var ilink = iframe.createElement("link");
    ilink.setAttribute("rel", "stylesheet");
    ilink.setAttribute("type", "text/css");
    ilink.setAttribute("href", "style.css");
    var styles = otherhead.appendChild(ilink);
    var css = '' +
              '.timeline {  font-size:11px !important; color:red;}' +
              '';
    styles.innerHTML = css;     
}
setTimeout('tweakstyle()',1000); // to make sure the twitter code has generated it's stuff

But that gave me an invalid cross domain error on the first line.
Does anybody have a suggestion? I googled and none of the solutions that came up work for me.

2
Contributors
3
Replies
16
Views
4 Years
Discussion Span
Last Post by Coloradojaguar
0

@alex, thanks for the reply.
I used the new timeline widget as a followup of the old twitter widget, where you could override style settings easily.
I guess I have to look for another followup: I cannot believe that I'm the only one that has a serious problem with a widget that stopped working suddenly, to be replaced by a widget that is infinitely worse (no search parameter you can pass, no auto scroll, not customisable except for a very few lame options)

0

I know this is an older post but I was wondering if the twitter cards now resolve these types of issues or have they induced more problems?

0

Thinking about this for a few minutes I have obviously misposted. You are talking about the timeline widget not the actual tweets, much less the cards.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.