?
Solved

Adding and removing scrollbars on a frame with NS

Posted on 2003-03-06
4
Medium Priority
?
311 Views
Last Modified: 2008-02-01

I need to be able to dynamically add and remove scrollbars from an html frame. I have this working fine in IE using:

  document.body.scroll="yes | no";  

But I can't get it to work in Netscape. The documentation says that I can use:

  scrollbars.visible=true | false;

However, to make it work I have to enable the  UniversalBrowserWrite privilege in Netscape. I'm not sure how to do this (and I'm not sure if I want to do this!).

Is there any easier way to do this?

Thanks,

dv
0
Comment
Question by:vanfleet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Expert Comment

by:JoaTex
ID: 8085468
Hi I'm not quite sure in Netscape but try This and tell me about:

<IFRAME SRC="Teste.html" NAME="myIframe" WIDTH="400" HEIGHT="200" SCROLLING="No"></IFRAME>
Jo
0
 
LVL 5

Expert Comment

by:gator4life
ID: 8086709
I found this in some reference material:

As with Java signed objects, signed scripts use calls to Netscape's Java security classes to request expanded privileges. The Java classes are explained in Java Capabilities API.

In the simplest case, you add one line of code asking permission to access a particular target representing the resource you want to access. (See "Targets" on page 226 for more information.) For example:

netscape.security.PrivilegeManager.enablePrivilege("UniversalSendMail")
When the script calls this function, the signature is verified, and if the signature is valid, expanded privileges can be granted. If necessary, a dialog box displays information about the application's author, and gives the user the option to grant or deny expanded privileges.

Privileges are granted only in the scope of the requesting function and only after the request has been granted in that function. This scope includes any functions called by the requesting function. When the script leaves the requesting function, privileges no longer apply.

The following example demonstrates this by printing this text:

7: disabled5: disabled2: disabled3: enabled1: enabled4: enabled6: disabled8: disabled
Function g requests expanded privileges, and only the commands and functions called after the request and within function g are granted privileges.

<SCRIPT ARCHIVE="ckHistory.jar" ID="a">
function printEnabled(i) {   if (history[0] == "") {      document.write(i + ": disabled<BR>");   } else {      document.write(i + ": enabled<BR>");    }}
function f() {   printEnabled(1); }
function g() {   printEnabled(2);   netscape.security.PrivilegeManager.enablePrivilege(      "UniversalBrowserRead");   printEnabled(3);   f();   printEnabled(4); }
function h() {   printEnabled(5);   g();    printEnabled(6); }
printEnabled(7); h(); printEnabled(8);
</SCRIPT>
Targets
The types of information you can access are called targets. These are listed in the following table.

Target  Description  
UniversalBrowserRead
 Allows reading of privileged data from the browser. This allows the script to pass the same origin check for any document.
 
UniversalBrowserWrite
 Allows modification of privileged data in a browser. This allows the script to pass the same origin check for any document.
 
UniversalBrowserAccess
 Allows both reading and modification of privileged data from the browser. This allows the script to pass the same origin check for any document.
 
UniversalFileRead
 Allows a script to read any files stored on hard disks or other storage media connected to your computer.
 
UniversalPreferencesRead
 Allows the script to read preferences using the navigator.preference method.
 
UniversalPreferencesWrite
 Allows the script to set preferences using the navigator.preference method.
 
UniversalSendMail
 Allows the program to send mail in the user's name.
 
JavaScript Features Requiring Privileges
This section lists the JavaScript features that require expanded privileges and the target used to access each feature. Unsigned scripts cannot use any of these features, unless the end user has enabled codebase principals.


Setting a file upload widget requires UniversalFileRead.

Submitting a form to a mailto: or news: URL requires UniversalSendMail.

Using an about: URL other than about:blank requires UniversalBrowserRead.

event object: Setting any property requires UniversalBrowserWrite.

DragDrop event: Getting the value of the data property requires UniversalBrowserRead.

history object: Getting the value of any property requires UniversalBrowserRead.

navigator object:

Getting the value of a preference using the preference method requires UniversalPreferencesRead.

Setting the value of a preference using the preference method requires UniversalPreferencesWrite.

window object: Allow of the following operations require UniversalBrowserWrite.

Adding or removing the directory bar, location bar, menu bar, personal bar, scroll bar, status bar, or toolbar.

Hope this helps!

gator4life
(chomp, chomp)
0
 

Accepted Solution

by:
spacepleb earned 400 total points
ID: 8087613
You may find the overflow style declaration useful:

<style type="text/css">
<!--
body {overflow: hidden}
-->
</style>

You should then be able to access this via the DOM.
0
 

Author Comment

by:vanfleet
ID: 8945878
Spacepleb, your suggestion worked perfectly for both Netscape and IE. Sorry it took me so long to get back to you.

Thanks,

vanfleet

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question