Pinned Google Chrome

  • Google Chrome

    Hello,

    Since Google Chrome version 21 you can install extensions and userscripts only from the google store (to reduce security risks).
    Currently nearly all Ogame extensions and userscripts aren't hostet in the google webstore, so you have to use the workaround to install / update them.

    - Store the extension or userscript on your computer (right click on it and choose "Save link ..." )
    - Open the windows explorer (or finder for mac user) where the file is located.
    - Click in Chrome onto the screw-wrench on the top right, choose "Tools" and then "Extensions".
    - Drag and drop the stored file into the chrome extensions tab.
    - Since Chrome 33 you have to enable the develope mode.

    See support.google.com/chrome_webs…rx_warning&answer=2664769 -> Steps on adding extensions from other websites

    Regards, Francolino
  • Security changes within Chrome 27

    Dear developer,

    There are some changes in Chrome 27 (currently only DEV version) which may cause problems in your userscript.

    One important detail is that's not longer possible to access the global window of the page ( = unsafeWindow ).

    The simplest solution is to inject the code into the page with a script tag.


    Example error ( TM message)

    ERROR: Execution of script '...' failed! Cannot call method 'getScript' of undefined




    Example basic code:


    Source Code

    1. scriptNode = document.createElement('script');
    2. scriptNode.setAttribute('type','text/javascript');
    3. scriptNode.textContent = '(' + yourFunction.toString() + ')();';
    4. document.body.appendChild( scriptNode );



    EDIT benneb , for testing : dev.chromium.org/getting-involved/dev-channel

    for firefox + chrome + chrome +TM :

    Source Code

    1. if (window.navigator.userAgent.indexOf('Chrome') > -1)
    2. {
    3. var scriptNode = document.createElement('script');
    4. scriptNode.setAttribute('type','text/javascript');
    5. scriptNode.textContent = '(' + yourFunction.toString() + ')();';
    6. document.body.appendChild( scriptNode );
    7. }
    8. else
    9. yourFunction();
  • Francolino wrote:

    for firefox + chrome + chrome +TM :

    Source Code

    1. if (window.navigator.userAgent.indexOf('Chrome') > -1)
    2. {
    3. var scriptNode = document.createElement('script');
    4. scriptNode.setAttribute('type','text/javascript');
    5. scriptNode.textContent = '(' + yourFunction.toString() + ')();';
    6. document.body.appendChild( scriptNode );
    7. }
    8. else
    9. yourFunction();

    It's more safe to use code injection in Firefox as well ;)
    and it could avoid problems due to lack of testing on every browsers

    Warsaalk wrote:

    This may be a little bit faster, correct me if i'm wrong

    Source Code

    1. var s = document.createElement('script');
    2. s.src = '[url to your script]';
    3. (document.head||document.documentElement).appendChild(s);

    How could it be faster since it has to download the script before executing it?