Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8015641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:18:34+00:00 2026-06-04T20:18:34+00:00

I am designing a new bookmarklet and I am testing it on Opera. This

  • 0

I am designing a new bookmarklet and I am testing it on Opera.

This is my code:

javascript:(function(){var a=window.open('http://www.google.com','Ok','left='+((window.screenLeft||window.screenX)+10)+',top='+((window.screenY||window.screenTop)+0)+',height=200px,width=400px,resizable=1,alwaysRaised=1,location=1,links=0,scrollbars=0,toolbar=0');window.setTimeout(function(){a.focus()},250)})();

The problem is that the new window doesn’t appear on the top but at about 200px from the top ( in other browsers like internet explorer, firefox and chrome it works well ).

So, Why this window doesn’t appear on the top in Opera ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:18:36+00:00Added an answer on June 4, 2026 at 8:18 pm

    Your problem comes from the fact that in Opera, both window.screenY and window.screenTop are defined, and screenY seems to always equal 0 which is a falsy value in JavaScript, so

    window.screenY||window.screenTop
    

    would always return window.screenTop in Opera while you actually need the first value.

    The proper way of checking is:

    'screenY' in window ? window.screenY : window.screenTop
    

    Here is your complete code, I also updated the check for screenLeft / screenX:

    javascript:(function(){var a=window.open('http://www.google.com','Ok','left='+(('screenLeft' in window ? window.screenLeft : window.screenX)+10)+',top='+(('screenY' in window ? window.screenY : window.screenTop)+0)+',height=200px,width=400px,resizable=1,alwaysRaised=1,location=1,links=0,scrollbars=0,toolbar=0');window.setTimeout(function(){a.focus()},250)})();
    

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I were designing a new system, should I have each function open and
I'm designing a new newsletter which looks great in Opera, Firefox and Chrome, but
I'm designing a new app for iPad for a small company. This app will
When designing a new system or getting your head around someone else's code, what
When designing a new object model I always start with the class diagram function
When designing a new testing system, Should I keep tests in tree with the
I have this task of designing a new interface for a distributed application (multiple
While designing a new WPF application I noticed exceptions not being thrown during data
I'm designing a new protocol called DITP. It is a connection oriented protocol that
I am designing a new laboratory database. I want to store the raw results

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.