Help get this topic noticed by sharing it on Twitter, Facebook, or email.

matchpages not working with framesets?

I want to affect a piece of the page which is in a frameset. GM scripts do this automatically, but the http://crossrider.wiki.zoho.com/Match... functionality seems to not work here.

what's a best practice? Do I have to do something ugly to get my app to run within the context of a page inside a frame?
1 person has
this question
+1
Reply
  • Actually, this is even worse. Crossrider doesn't work with framesets period.
    Error in event handler for 'undefined': TypeError: Cannot call method 'appendChild' of undefined
    at chrome-extension://ljjlegifgciifnhafgldpohkjgdhonhc/js/lib/app_api.js:41:47
    at chrome/RendererExtensionBindings:239:13
    at [object Object].dispatch (chrome/EventBindings:181:28)
    a

    The DOM looks like

    ...

    So the code in app_api.js which is trying to get the "body" tag is failing :( This sucks. I really want to just mess with one of the frames. How should I go about doing this? I'm obviously not going to be able to use crossrider unless this bug is fixed, right?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly

  • Jacob,

    If I understand what you are trying to do, then Crossrider (for now) is running only on the page scope. (You can get the appAPI object on an external iframe - but only if you have "ownership" of that page)

    This means that you can not run the code that will affect the content of a <frame> with external document, inside a <frameset>.

    If you can explain better what you are trying to do, then I might be able to help with alternative solutions.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Thanks for the response, unfortunately, GS has swallowed a lot of HTML so it doesn't make a lot of sense to me though... Here is the DOM:
    html
    - frameset
    - frame[@name='header'] src="pageIdonotcareabout.asp"
    - frame[@name='content'] src="PageICareAbout.asp"
    (something like this).
    The code in app_api.js on line 41 does this:
    document.getElementsByTagName('body')[0].appendChild(div);

    since there is no body element, this fails.

    What I'm really looking to do here is to run my extension when the user visits PageICareAbout.asp. I have a greasemonkey script meant to run on whatever.com/PageICareAbout.asp and it works great.

    My CR extension also works now if I visit PageICareAbout.asp directly, but if it is in the frameset, the above happens. My assumption was that the plugin would try to run once for every frame on the page, not once for the whole page, and that it wouldn't just completely die w/o the body element.

    I know that the frameset tag is stupid. The point is I'm trying to improve a really lousy application. And the only way I can do that is with a browser extension. Since our team uses FF and Chrome, I have to use this software - and indeed have build out most of it. Please help me :)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly

  • So really, this means any CR extension breaks on any page without a body element (i.e. framesets).
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly

  • Here's a patch which fixes this:

    --- js/lib/app_api.js 2011-08-17 18:07:44.000000000 -0400
    +++ /other/app_api.js 2011-08-17 13:44:42.000000000 -0400
    @@ -38,7 +38,12 @@
    if(stub === null){
    var div = document.createElement('div');
    div.id = 'crossrider-app-stub'+appID;
    - document.getElementsByTagName('body')[0].appendChild(div);
    + if ((document.getElementsByTagName('body').length == 0) && (document.getElementsByTagName('frameset') > 0)) {
    + document.getElementsByTagName('frameset')[0].appendChild(div);
    + } else {
    + document.getElementsByTagName('body')[0].appendChild(div);
    + }
    +
    chrome.extension.sendRequest({action:'addUserScripts'}, function(){});
    }
    });
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly

  • Thanks for the patch Singh!
    And for all you comments and insights in general ;)

    Crossrider is not "breaking" on the frameset page - it's simply not running.
    For now Crossrider is designed to run on "valid" and modern HTML pages only.

    Will keep you update if & when we will change this behavior.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly

  • I’m sad
    It is breaking. The fact is, frameset is a bad practice, but not *that* old. Plus, consider your audience. If you want to eventually offer commercial support, who is going to buy that? Enterprises. Why would they buy it? Because they have to improve legacy apps or integrate several legacy apps and the best way to do that is via the browser.

    Legacy apps are not "valid" or "modern", they are legacy and crap. That's the point. If all my apps were "valid" and "modern", I wouldn't use CR, I'd just write GM scripts.

    Any chance of getting this fixed on your roadmap? Either frameset support or running once on every frame?

    If not, I am going to have to abandon CR and go for other approaches. Sucks because this has the potential to be a really good real case study for you guys.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly

  • Just ran into the same problem as Jacob. Jacob's page works, although I believe running inside of frames requires more than just that patch (e.g. for chrome, you must edit the manifest.json file). Fact is, some enterprise software still uses frames, and because this software typically sucks, why not build an extension to fix it! Just a thought :)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • I wish this thread would get some more love. This is a good startup idea. My guess is the founders have jobs and don't give it their full attention because there is very little movement in features or support now. too bad.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly

  • EMPLOYEE
    I’m sad
    Hey Jacob,

    Our full time (200%) job is Crossrider and we are doing our best to furfill the requests of all our users.

    For now, I am sorry to say that I don't see <frameset> support being added to Crossrider (at least not in the near future).
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly

  • Just to keep this thread up to date:

    Crossrider Extensions are now running also on FRAMESET pages.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly