I think that the problem cannot be solved, because this check must be performed on the server, and the check cannot be performed due to the limitations of Tumblr Theme .
UPDATE: Revert to JS Version
Frames List:
Various blocks of code from these frames:
Tumblr iframe for non-registered users:
<script type="text/javascript"> var logged_in = (document.cookie.indexOf('logged_in=1') != -1); </script> … <div style="position:absolute; top:3px; right:3px; white-space:nowrap; height:20px;"> <span id="logged_out_controls" style="display:none;"> <a href="https://www.tumblr.com/register" target="_top" id="follow_link"> <img id="follow_image" alt="Follow" style="width:58px;"/> </a> <a href="https://www.tumblr.com/register/join_tumblr" target="_blank" id="join_link"> <img id="join_image" alt="Join Tumblr" style="width:105px;"/> </a> </span> </div>
Tumblr iframe for registered users [owner]:
<div style="position:absolute; top:3px; right:3px; white-space:nowrap; height:20px;"> <a target="_top" href="http://www.tumblr.com/customize?redirect_to=http%3A%2F%2Fexample.com%2F"> <img src="http://assets.tumblr.com/images/iframe_customize_alpha.png?1016" alt="Customize" style="height:20px;width:80px; border-width:0px; display:block; float:left; cursor:pointer;" /> </a> <a target="_top" href="http://www.tumblr.com/dashboard"> <img src="http://assets.tumblr.com/images/iframe_dashboard_alpha.png?1016" alt="Dashboard" style="height:20px; width:81px; border-width:0px; display:block; float:left; cursor:pointer;" /> </a> </div>
Tumblr iframe for registered users [non-owner]:
<div style="position:absolute; top:3px; right:3px; white-space:nowrap; height:20px;"> <form action="/follow" method="post" style="display:block; float:left;"onsubmit="_gaq.push(['_trackEvent', 'Iframe', 'Follow', 'example-com');"> <input type="hidden" name="form_key" value="83jbGySgEVpQGOoZALqqoSaKfjs"/> <input type="hidden" name="id" value="example-com"/> <input type="image" src="http://assets.tumblr.com/images/iframe_follow_alpha.png?1016"style="width:58px; height:20px; border-width:0px; display:block;margin-left:3px; cursor:pointer;"alt="Follow"/> </form> <a target="_top" href="http://www.tumblr.com/dashboard"> <imgsrc="http://assets.tumblr.com/images/iframe_dashboard_alpha.png?1016" alt="Dashboard" style="height:20px; width:81px; border-width:0px; display:block; float:left; cursor:pointer;"/> </a> </div>
Differences that can be detected:
Iframe for not registered has a strange script line:
Iframe for registered users [owner] :
Iframe for registered users [not owner] :
Conclusion
However, I find this solution rather fragile, I think it is possible to detect the user domain of the current blog based on the diffs listed above.
source share