Ken Paul
Ken Paul

Reputation: 5765

Best way to read/set IE options?

What is the best way to read and/or set Internet Explorer options from a web page in Javascript? I know that these are in registry settings.

For example, I'm using the JavaScript Diagram Builder to dynamically generate bar charts within a web page. This uses the background color in floating DIVs to generate the bars. I would like to be able to read the browser setting for printing background colors, and if not checked, either warn the user that the colors won't print, or programatically select this option.

EDIT: As I think about the products that do something similar, I think they mostly just test whether Java or JavaScript or Cookies are disabled, which can be done without reading the registry.

So I guess the consensus is that what I want to do shouldn't be attempted.

Upvotes: 0

Views: 621

Answers (3)

Lee Kowalkowski
Lee Kowalkowski

Reputation: 11751

You can style the bars using a whopping left border instead of using a background colour.

Like this:

<style>
    div.bar
    {
      width:1px;
      border-left:10px solid red;
    }
</style>
<div class="bar" style="height:100px"></div>

Obviously depends on the versatility of the product you're using. But I don't see why it would hurt to do this in a print style sheet at least.

Upvotes: 1

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114367

Web pages have no business reading users' settings, therefore there is no interface for this.

Upvotes: 5

sblundy
sblundy

Reputation: 61414

This sounds like it would be a big security hole, one that the IE team would keep nailed very shut

Upvotes: 0

Related Questions