Best way to read/set IE options?

a 夏天 提交于 2019-12-11 14:58:22

问题


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.


回答1:


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




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/251696/best-way-to-read-set-ie-options

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!