#598 new
nallar

@run-at document-start results in no execution on iframes

Reported by nallar | February 22nd, 2012 @ 12:46 PM

  1. Your operating system (and version) - Windows 7 64-bit- irrelevant, replicated on XP
  2. Your browser (and version) FF 10.0.2 - Irrelevant, replicated on latest Aurora
  3. The version of Scriptish you are using - 0.1.7
  4. Your language and/or locale (e.g. "en-US") - en-GB
  5. Clear steps to reproduce the bug (including a reduced-case user script, if applicable) - Use metadata tag @run-at document start which alerts if running in an iframe. - http://pastebin.com/8itTTyRU
  6. Any error messages seen in the Error Console - none
  7. A description of what you expected to happen - Alert appears when visiting a page with an iframe
  8. A description of what actually happened - Nothing

Additional information - this bug also occurs with GreaseMonkey, but not with TamperMonkey. The only workaround currently is annoying, and requires giving two versions of the script, one which is document-start and one without an @run-at.

Comments and changes to this ticket

  • dindog

    dindog March 5th, 2012 @ 01:52 AM

    As I remember, Greasemonkey won't load userscript if it's @run-at document-start, I read that in a issue of github of GM.

    An as far as I test, Scriptish does well in that parts. Try the nightly version of Scriptish and see what happen:
    https://github.com/scriptish/scriptish-nightlies/downloads

  • nallar

    nallar March 5th, 2012 @ 11:37 AM

    Scriptish still fails to execute userscripts with @run-at document-start in iframes as of the latest nightly. :(

  • dindog

    dindog March 8th, 2012 @ 12:44 AM

    I don't think that is true, for I used that everyday. And I am using Nightly too.

  • dindog

    dindog March 8th, 2012 @ 12:58 AM

    FYI, you 'alert' script works for me too.

  • nallar

    nallar March 8th, 2012 @ 08:57 AM

    Oh, I forgot to also test stable with the nightly, I just tested on Aurora.

    Browser | Scriptish | Success?
    FF10 | Nightly | alert!
    FF12 | Nightly | no alert
    FF10 | 0.17 | no alert
    FF12 | 0.17 | no alert

    (I don't know how to debug further, and I saw no JS errors in either console)

    Quick question, 'The default value for extensions.scriptish.cache.enabled is false.' - why? Surely in most cases setting it to true by default is better? Does it cause issues? :(

  • nallar

    nallar March 8th, 2012 @ 10:31 AM

    Another FF12 test:

    On http://www.reddit.com/tb/qn923 it only runs on some of the iframes. Never seems to run on the iframe for the comments.

  • dindog

    dindog March 8th, 2012 @ 09:50 PM

    Test with Nightly, Aurora and 10.0.2 all with Nightly Scriptish, all pass.
    And the comment you mention above frame name is reddit_link, also got log in my test script:

    // ==UserScript==
    // @id             test@dindog
    // @version        1.0
    // @namespace      test@dindog
    // @include        http*
    // @run-at         document-start
    // ==/UserScript==
    console.log(frame(), 'start');
    document.addEventListener('DOMContentLoaded', 
        console.log(frame(), 'end'), false);
    
    window.addEventListener('load', function(e) {
        console.log(frame(), 'load');
    }, false);
    
    function frame() {
        if (window == window.top) {
            return "top window: ";
        } else {
            return window.name+"     frame: ";
        };
    }
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket