www.webdeveloper.com
Results 1 to 5 of 5

Thread: change of window title after completely loaded website

  1. #1
    Join Date
    Aug 2010
    Posts
    3

    change of window title after completely loaded website

    hi everyone,
    i would like to write a script which will change title of my opera window after opera completely loads web page.
    i have a working script:

    Code:
    // ==UserScript== 
    // @name           loaded 
    // @namespace      my 
    // @description    indicate if a page is loded 
    // @include        http://examplesite.com/
    // ==/UserScript== 
    
    
    window.addEventListener( 
      'load', 
      function (e) { 
        document.title += " [loaded]"; 
     }, false);
    the problem i have is that i don't know exacly address of the website that i'm waiting on. it could be http://subdomain1.examplesite.com/asdasdasd, it could be http://anothersubdomainexamplesite.c...weyruyweuiyrwe and so on.
    i tried to add
    // @include http://*.examplesite.com/
    but i don't know js and it doesn't work.

    can anyone help with it? sorry if it's a trivial problem.
    thanks in advance.

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    Code:
    // @include http://*examplesite*/
    // @include http://*.examplesite.com/*
    // @include http://www.examplesite.com/*
    // @include http://*.www.examplesite.com/*
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Aug 2010
    Posts
    3
    can you tell me why it's not working with this addres: http://u11.hotfile.com/upload.cgi?12812169999897014 ?

  4. #4
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    try this

    Code:
    // ==UserScript== 
    // @name           loaded 
    // @namespace      my 
    // @description    indicate if a page is loded 
    // @include        http://u11.hotfile.com/
    // @include http://*hotfile*/
    // @include http://*.hotfile.com/*
    // @include http://www.hotfile.com/*
    // @include http://*.www.hotfile.com/*
    // ==/UserScript== 
    
     window.onload = function(){
     var ttl = document.createElement('title');
     ttl.innerHTML = location  +  ' [loaded]';
     document.getElementsByTagName('HEAD')[0].appendChild(ttl);
     }
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  5. #5
    Join Date
    Aug 2010
    Posts
    3
    as i remember it would still not work with the page i had. the problem was my page didn't have a <title> element at all. at opera user javascript forum i received a working in this case solution:
    Code:
    var text = " [loaded]";
    if(document.title){
      document.title += text; 
    }else{
      document.write("<title>"+text+"</title>");
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles