简体   繁体   中英

Set localStorage or global variables before setting Gemini url

Is there a way to alter any global variable or localStorage item before loading the url specified in Gemini's setUrl?

I tried using executeJS but whatever I set is not available for the app initialization:

suite
  .setUrl( 'index.html' )
  .before( function( actions, find ) {
    actions.executeJS( function( window ) {
      localStorage.setItem( 'key', 'value' );
      navigator.language = 'sk';
      globalConfig.flag = true;
    });
  });

Actually there is an issue in gemini-testing addressing this usage.

Basically setUrl() needs to be called again after the values are set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM