mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
spring cleaning in extensions/wallet, bug 204184.
hunting season is open! r=timeless, sr=bryner.
This commit is contained in:
parent
646e3ffe37
commit
6a1a2f65cf
@ -1,362 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Cookies</title>
|
||||
<script>
|
||||
|
||||
/* for xpconnect */
|
||||
var cookieviewer =
|
||||
Components.classes
|
||||
["@mozilla.org/cookieviewer/cookieviewer-world;1"].createInstance();
|
||||
cookieviewer = cookieviewer.QueryInterface(Components.interfaces.nsICookieViewer);
|
||||
|
||||
function DoGetCookieList()
|
||||
{
|
||||
return cookieviewer.GetCookieValue();
|
||||
}
|
||||
|
||||
function DoGetPermissionList()
|
||||
{
|
||||
return cookieviewer.GetPermissionValue();
|
||||
}
|
||||
|
||||
function DoSave(value)
|
||||
{
|
||||
cookieviewer.SetValue(value, window);
|
||||
}
|
||||
/* end of xpconnect stuff */
|
||||
|
||||
index_frame = 0;
|
||||
title_frame = 1;
|
||||
spacer1_frame = 2;
|
||||
list_frame = 3;
|
||||
spacer2_frame = 4;
|
||||
prop_frame = 5;
|
||||
spacer3_frame = 6;
|
||||
button_frame = 7;
|
||||
|
||||
var cookie_mode;
|
||||
var cookieList = [];
|
||||
var permissionList = [];
|
||||
deleted_cookies = new Array;
|
||||
deleted_permissions = new Array;
|
||||
|
||||
function DeleteItemSelected() {
|
||||
if (cookie_mode == 0) {
|
||||
DeleteCookieSelected();
|
||||
} else if (cookie_mode == 1) {
|
||||
DeletePermissionSelected();
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteCookieSelected() {
|
||||
selname = top.frames[list_frame].document.fSelectCookie.selname;
|
||||
goneC = top.frames[button_frame].document.buttons.goneC;
|
||||
var p;
|
||||
var i;
|
||||
for (i=selname.options.length; i>0; i--) {
|
||||
if (selname.options[i-1].selected) {
|
||||
selname.options[i-1].selected = 0;
|
||||
goneC.value = goneC.value + selname.options[i-1].value + ",";
|
||||
deleted_cookies[selname.options[i-1].value] = 1;
|
||||
selname.remove(i-1);
|
||||
}
|
||||
}
|
||||
top.frames[prop_frame].document.open();
|
||||
top.frames[prop_frame].document.close();
|
||||
}
|
||||
|
||||
function DeletePermissionSelected() {
|
||||
selname = top.frames[list_frame].document.fSelectPermission.selname;
|
||||
goneP = top.frames[button_frame].document.buttons.goneP;
|
||||
var p;
|
||||
var i;
|
||||
for (i=selname.options.length; i>0; i--) {
|
||||
if (selname.options[i-1].selected) {
|
||||
selname.options[i-1].selected = 0;
|
||||
goneP.value = goneP.value + selname.options[i-1].value + ",";
|
||||
deleted_permissions[selname.options[i-1].value] = 1;
|
||||
selname.remove(i-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function loadCookies(){
|
||||
cookie_mode = 0;
|
||||
top.frames[index_frame].document.open();
|
||||
top.frames[index_frame].document.write(
|
||||
"<body bgcolor='#c0c0c0'>" +
|
||||
"<table border='0' width='100%'>" +
|
||||
"<tr>" +
|
||||
"<td align='center' valign='middle' bgcolor='#ffffff'>" +
|
||||
"<font size='2' color='#666666'>" +
|
||||
"<b>View stored cookies</b>" +
|
||||
"</font>" +
|
||||
"</td>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadPermissions();' href=''>" +
|
||||
"<font size='2'>View sites that can or cannot store cookies</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</body>"
|
||||
);
|
||||
top.frames[index_frame].document.close();
|
||||
|
||||
top.frames[title_frame].document.open();
|
||||
top.frames[title_frame].document.write
|
||||
(" Cookies stored on your system");
|
||||
top.frames[title_frame].document.close();
|
||||
|
||||
top.frames[prop_frame].document.open();
|
||||
top.frames[prop_frame].document.close();
|
||||
|
||||
loadCookiesList();
|
||||
}
|
||||
|
||||
function ViewCookieSelected() {
|
||||
index = 8*(top.frames[list_frame].document.fSelectCookie.selname.selectedIndex) + 1;
|
||||
top.frames[prop_frame].document.open();
|
||||
top.frames[prop_frame].document.write(
|
||||
"<nobr><b>Name: </b>" + cookieList[index+1] + "</nobr><br/>" +
|
||||
"<nobr><b>Value: </b>" + cookieList[index+2] + "</nobr><br/>" +
|
||||
"<nobr><b>" + cookieList[index+3] + ": </b>" + cookieList[index+4] + "</nobr><br/>" +
|
||||
"<nobr><b>Path: </b>" + cookieList[index+5] + "</nobr><br/>" +
|
||||
"<nobr><b>Secure: </b>" + cookieList[index+6] + "</nobr><br/>" +
|
||||
"<nobr><b>Expires: </b>" + cookieList[index+7] + "</nobr><br/>"
|
||||
);
|
||||
top.frames[prop_frame].document.close();
|
||||
}
|
||||
|
||||
function loadCookiesList(){
|
||||
top.frames[list_frame].document.open();
|
||||
top.frames[list_frame].document.write(
|
||||
"<form name='fSelectCookie'>" +
|
||||
"<p>" +
|
||||
"<b>site:cookie-name</b>" +
|
||||
"<table border='0'>" +
|
||||
"<tr>" +
|
||||
"<td width='100%' valign='top'>" +
|
||||
"<center>" +
|
||||
"<p>" +
|
||||
"<select name='selname' size='10' multiple='multiple' onchange='top.ViewCookieSelected();'>"
|
||||
);
|
||||
for (i=1; !(i>=cookieList.length); i+=8) {
|
||||
if (!deleted_cookies[cookieList[i]]) {
|
||||
top.frames[list_frame].document.write(
|
||||
"<option value=" + cookieList[i] + ">" +
|
||||
cookieList[i+4] + ":" + cookieList[i+1] +
|
||||
"</option>"
|
||||
);
|
||||
}
|
||||
}
|
||||
top.frames[list_frame].document.write(
|
||||
"</select>" +
|
||||
"</p>" +
|
||||
"</center>" +
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</p>" +
|
||||
"</form>"
|
||||
);
|
||||
top.frames[list_frame].document.close();
|
||||
}
|
||||
|
||||
function loadPermissions(){
|
||||
cookie_mode = 1;
|
||||
top.frames[index_frame].document.open();
|
||||
top.frames[index_frame].document.write(
|
||||
"<body bgcolor='#c0c0c0'>" +
|
||||
"<table border='0' width='100%'>" +
|
||||
"<tr>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadCookies();' href=''>" +
|
||||
"<font size='2'>View stored cookies</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"<td align='center' valign='middle' bgcolor='#ffffff'>" +
|
||||
"<font size='2' color='#666666'>" +
|
||||
"<b>View sites that can or cannot store cookies</b>" +
|
||||
"</font>" +
|
||||
"</td>" +
|
||||
"<td> </td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</body>"
|
||||
);
|
||||
top.frames[index_frame].document.close();
|
||||
|
||||
top.frames[title_frame].document.open();
|
||||
top.frames[title_frame].document.write
|
||||
(" Sites that can(+) or cannot(-) store cookies");
|
||||
top.frames[title_frame].document.close();
|
||||
|
||||
top.frames[prop_frame].document.open();
|
||||
top.frames[prop_frame].document.close();
|
||||
|
||||
loadPermissionsList();
|
||||
}
|
||||
|
||||
function loadPermissionsList(){
|
||||
top.frames[list_frame].document.open();
|
||||
top.frames[list_frame].document.write(
|
||||
"<form name='fSelectPermission'>" +
|
||||
"<p>" +
|
||||
"<table border='0'>" +
|
||||
"<tr>" +
|
||||
"<td width='100%' valign='top'>" +
|
||||
"<center>" +
|
||||
"<p>" +
|
||||
"<select name='selname' size='10' multiple='multiple'> "
|
||||
);
|
||||
for (i=1; !(i>=permissionList.length); i+=2) {
|
||||
if (!deleted_permissions[permissionList[i]]) {
|
||||
top.frames[list_frame].document.write(
|
||||
"<option value=" + permissionList[i] + ">" +
|
||||
permissionList[i+1] +
|
||||
"</option>"
|
||||
);
|
||||
}
|
||||
}
|
||||
top.frames[list_frame].document.write(
|
||||
"</select>" +
|
||||
"</p>" +
|
||||
"</center>" +
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</p>" +
|
||||
"</form>"
|
||||
);
|
||||
top.frames[list_frame].document.close();
|
||||
}
|
||||
|
||||
function loadButtons(){
|
||||
top.frames[button_frame].document.open();
|
||||
top.frames[button_frame].document.write(
|
||||
"<form name='buttons'>" +
|
||||
"<br/>" +
|
||||
" " +
|
||||
"<button onclick='top.DeleteItemSelected();'>Remove</button>" +
|
||||
"<div align='right'>" +
|
||||
"<button onclick='parent.Save();'>OK</button>" +
|
||||
" " +
|
||||
"<button onclick='parent.Cancel();'>Cancel</button>" +
|
||||
"</div>" +
|
||||
"<input type='hidden' name='goneC' value='' size='-1'/>" +
|
||||
"<input type='hidden' name='goneP' value='' size='-1'/>" +
|
||||
"<input type='hidden' name='cookieList' value='' size='-1'/>" +
|
||||
"<input type='hidden' name='permissionList' value='' size='-1'/>" +
|
||||
"</form>"
|
||||
);
|
||||
top.frames[button_frame].document.close();
|
||||
}
|
||||
|
||||
function loadFrames(){
|
||||
|
||||
/*
|
||||
* The cookieList is a sequence of items separated by the BREAK character. These
|
||||
* items are:
|
||||
* empty
|
||||
* number for first cookie
|
||||
* name for first cookie
|
||||
* value for first cookie
|
||||
* domain indicator ("Domain" or "Host") for first cookie
|
||||
* domain or host name for first cookie
|
||||
* path for first cookie
|
||||
* secure indicator ("Yes" or "No") for first cookie
|
||||
* expiration for first cookie
|
||||
* with the eight items above repeated for each successive cookie
|
||||
*/
|
||||
list = DoGetCookieList();
|
||||
BREAK = list[0];
|
||||
cookieList = list.split(BREAK);
|
||||
|
||||
/*
|
||||
* The permissionList is a sequence of items separated by the BREAK character. These
|
||||
* items are:
|
||||
* empty
|
||||
* number for first permission
|
||||
* +/- hostname for first permission
|
||||
* with the above two items repeated for each successive permission
|
||||
*/
|
||||
list = DoGetPermissionList();
|
||||
BREAK = list[0];
|
||||
permissionList = list.split(BREAK);
|
||||
loadCookies();
|
||||
loadButtons();
|
||||
}
|
||||
|
||||
function Save(){
|
||||
var goneC = top.frames[button_frame].document.buttons.goneC;
|
||||
var goneP = top.frames[button_frame].document.buttons.goneP;
|
||||
var result = "|goneC|"+goneC.value+"|goneP|"+goneP.value+"|";
|
||||
DoSave(result);
|
||||
}
|
||||
|
||||
function Cancel(){
|
||||
var result = "|goneC||goneP||";
|
||||
DoSave(result);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<frameset rows = "10,10,125,50" border="0" framespacing="0" onload="loadFrames();">
|
||||
<frame src="about:blank"
|
||||
name="index_frame"
|
||||
scrolling="no"
|
||||
marginwidth="1"
|
||||
marginheight="1"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
name="title_frame"
|
||||
scrolling="no"
|
||||
marginwidth="1"
|
||||
marginheight="1"
|
||||
noresize="noresize"/>
|
||||
<frameset cols="5,*,10,*,5" border="0" framespacing="0">
|
||||
<frame src="about:blank"
|
||||
name="spacer1_frame"
|
||||
scrolling="auto"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
name="list_frame"
|
||||
scrolling="auto"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
name="spacer2_frame"
|
||||
scrolling="auto"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
name="prop_frame"
|
||||
scrolling="auto"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
name="spacer3_frame"
|
||||
scrolling="auto"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
noresize="noresize"/>
|
||||
</frameset>
|
||||
<frame src="about:blank"
|
||||
name="button_frame"
|
||||
scrolling="no"
|
||||
marginwidth="1"
|
||||
marginheight="1"
|
||||
noresize="noresize"/>
|
||||
</frameset>
|
||||
|
||||
<noframes>
|
||||
<body> <P> </body>
|
||||
</noframes>
|
||||
</html>
|
@ -1,54 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = walletviewers
|
||||
LIBRARY_NAME = cookieviewer_s
|
||||
XPIDL_MODULE = cookieviewer
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
dom \
|
||||
js \
|
||||
gfx \
|
||||
layout \
|
||||
content \
|
||||
widget \
|
||||
cookie \
|
||||
docshell \
|
||||
uriloader \
|
||||
locale \
|
||||
necko \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = nsCookieViewer.cpp
|
||||
|
||||
XPIDLSRCS = nsICookieViewer.idl
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a static lib
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -1,202 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsIMemory.h"
|
||||
#include "plstr.h"
|
||||
#include <stdio.h>
|
||||
#include "nsICookieService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsCookieViewer.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CookieViewerImpl::CookieViewerImpl()
|
||||
{
|
||||
}
|
||||
|
||||
CookieViewerImpl::~CookieViewerImpl()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(CookieViewerImpl, nsICookieViewer)
|
||||
|
||||
NS_IMETHODIMP
|
||||
CookieViewerImpl::GetCookieValue(char** aValue)
|
||||
{
|
||||
NS_PRECONDITION(aValue != nsnull, "null ptr");
|
||||
if (!aValue) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsresult res;
|
||||
nsCOMPtr<nsICookieService> cookieservice =
|
||||
do_GetService(kCookieServiceCID, &res);
|
||||
if (NS_FAILED(res)) return res;
|
||||
nsAutoString cookieList;
|
||||
res = cookieservice->Cookie_GetCookieListForViewer(cookieList);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
*aValue = ToNewCString(cookieList);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CookieViewerImpl::GetPermissionValue(PRInt32 type, char** aValue)
|
||||
{
|
||||
NS_PRECONDITION(aValue != nsnull, "null ptr");
|
||||
if (!aValue) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsresult res;
|
||||
nsCOMPtr<nsICookieService> cookieservice =
|
||||
do_GetService(kCookieServiceCID, &res);
|
||||
if (NS_FAILED(res)) return res;
|
||||
nsAutoString PermissionList;
|
||||
res = cookieservice->Cookie_GetPermissionListForViewer(PermissionList, type);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
*aValue = ToNewCString(PermissionList);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CookieViewerImpl::SetValue(const char* aValue, nsIDOMWindowInternal* win)
|
||||
{
|
||||
/* process the value */
|
||||
NS_PRECONDITION(aValue != nsnull, "null ptr");
|
||||
if (! aValue) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsresult res;
|
||||
nsCOMPtr<nsICookieService> cookieservice =
|
||||
do_GetService(kCookieServiceCID, &res);
|
||||
if (NS_FAILED(res)) return res;
|
||||
nsAutoString netList; netList.AssignWithConversion(aValue);
|
||||
res = cookieservice->Cookie_CookieViewerReturn(netList);
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CookieViewerImpl::BlockImage(const char* imageURL)
|
||||
{
|
||||
NS_PRECONDITION(imageURL != nsnull, "null ptr");
|
||||
if (! imageURL) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsresult res;
|
||||
nsCOMPtr<nsICookieService> cookieservice =
|
||||
do_GetService(kCookieServiceCID, &res);
|
||||
if (NS_FAILED(res)) {
|
||||
return res;
|
||||
}
|
||||
nsAutoString imageURLAutoString; imageURLAutoString.AssignWithConversion(imageURL);
|
||||
res = cookieservice->Image_Block(imageURLAutoString);
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CookieViewerImpl::AddPermission(nsIDOMWindowInternal* aWin, PRBool permission, PRInt32 type)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
/* all the following is just to get the url of the window */
|
||||
|
||||
NS_PRECONDITION(aWin != nsnull, "null ptr");
|
||||
if (!aWin) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIScriptGlobalObject> scriptGlobalObject;
|
||||
scriptGlobalObject = do_QueryInterface(aWin);
|
||||
if(!scriptGlobalObject) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell;
|
||||
rv = scriptGlobalObject->GetDocShell(getter_AddRefs(docShell));
|
||||
if(NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
rv = docShell->GetPresShell(getter_AddRefs(presShell));
|
||||
if(NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
rv = presShell->GetDocument(getter_AddRefs(doc));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
if (!doc) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> docURL;
|
||||
doc->GetDocumentURL(getter_AddRefs(docURL));
|
||||
if (!docURL) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
char* spec;
|
||||
(void)docURL->GetSpec(&spec);
|
||||
nsAutoString objectURLAutoString; objectURLAutoString.AssignWithConversion(spec);
|
||||
Recycle(spec);
|
||||
|
||||
/* got the url at last, now pass it on to the Permission_Add routie */
|
||||
|
||||
nsCOMPtr<nsICookieService> cookieservice =
|
||||
do_GetService(kCookieServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
rv = cookieservice->Permission_Add(objectURLAutoString, permission, type);
|
||||
return rv;
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsICookieViewer.h"
|
||||
|
||||
class CookieViewerImpl : public nsICookieViewer
|
||||
{
|
||||
public:
|
||||
CookieViewerImpl();
|
||||
virtual ~CookieViewerImpl();
|
||||
|
||||
// nsISupports interface
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsICookieViewer interface
|
||||
NS_DECL_NSICOOKIEVIEWER
|
||||
};
|
@ -1,64 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
|
||||
A sample of XPConnect. This file contains a CookieViewer interface.
|
||||
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMWindowInternal;
|
||||
|
||||
[scriptable, uuid(BBB67DF0-214B-11d3-ABAA-0080C787AD96)]
|
||||
interface nsICookieViewer : nsISupports
|
||||
{
|
||||
void SetValue(in string aValue, in nsIDOMWindowInternal win);
|
||||
void BlockImage(in string imageURL);
|
||||
void AddPermission(in nsIDOMWindowInternal win, in PRBool permission, in PRInt32 type);
|
||||
string GetCookieValue();
|
||||
string GetPermissionValue(in PRInt32 type);
|
||||
|
||||
};
|
||||
|
||||
%{ C++
|
||||
// {BBB67DF0-214B-11d3-ABAA-0080C787AD96}
|
||||
#define NS_COOKIEVIEWER_CID \
|
||||
{ 0xbbb67df0, 0x214b, 0x11d3, { 0xab, 0xaa, 0x0, 0x80, 0xc7, 0x87, 0xad, 0x96 } }
|
||||
%}
|
@ -1,529 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Signons</title>
|
||||
<script>
|
||||
|
||||
/* for xpconnect */
|
||||
|
||||
var signonviewer =
|
||||
Components.classes
|
||||
["@mozilla.org/signonviewer/signonviewer-world;1"].createInstance();
|
||||
signonviewer = signonviewer.QueryInterface(Components.interfaces.nsISignonViewer);
|
||||
|
||||
function DoGetSignonList()
|
||||
{
|
||||
return signonviewer.GetSignonValue();
|
||||
}
|
||||
|
||||
function DoGetRejectList()
|
||||
{
|
||||
return signonviewer.GetRejectValue();
|
||||
}
|
||||
|
||||
function DoGetNopreviewList()
|
||||
{
|
||||
return signonviewer.GetNopreviewValue();
|
||||
}
|
||||
|
||||
function DoGetNocaptureList()
|
||||
{
|
||||
return signonviewer.GetNocaptureValue();
|
||||
}
|
||||
|
||||
function DoSave(value)
|
||||
{
|
||||
signonviewer.SetValue(value, window);
|
||||
}
|
||||
|
||||
/* end of xpconnect stuff */
|
||||
|
||||
index_frame = 0;
|
||||
title_frame = 1;
|
||||
spacer1_frame = 2;
|
||||
list_frame = 3;
|
||||
spacer2_frame = 4;
|
||||
button_frame = 5;
|
||||
|
||||
var signon_mode;
|
||||
var signonList = [];
|
||||
var rejectList = [];
|
||||
var nopreviewList = [];
|
||||
var nocaptureList = [];
|
||||
deleted_signons = new Array;
|
||||
deleted_rejects = new Array;
|
||||
deleted_nopreviews = new Array;
|
||||
deleted_nocaptures = new Array;
|
||||
|
||||
function DeleteItemSelected() {
|
||||
if (signon_mode == 0) {
|
||||
DeleteSignonSelected();
|
||||
} else if (signon_mode == 1) {
|
||||
DeleteRejectSelected();
|
||||
} else if (signon_mode == 2) {
|
||||
DeleteNopreviewSelected();
|
||||
} else if (signon_mode == 3) {
|
||||
DeleteNocaptureSelected();
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteSignonSelected() {
|
||||
selname = top.frames[list_frame].document.fSelectSignon.selname;
|
||||
goneS = top.frames[button_frame].document.buttons.goneS;
|
||||
var p;
|
||||
var i;
|
||||
for (i=selname.options.length; i>0; i--) {
|
||||
if (selname.options[i-1].selected) {
|
||||
selname.options[i-1].selected = 0;
|
||||
goneS.value = goneS.value + selname.options[i-1].value + ",";
|
||||
deleted_signons[selname.options[i-1].value] = 1;
|
||||
selname.remove(i-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteRejectSelected() {
|
||||
selname = top.frames[list_frame].document.fSelectReject.selname;
|
||||
goneR = top.frames[button_frame].document.buttons.goneR;
|
||||
var p;
|
||||
var i;
|
||||
for (i=selname.options.length; i>0; i--) {
|
||||
if (selname.options[i-1].selected) {
|
||||
selname.options[i-1].selected = 0;
|
||||
goneR.value = goneR.value + selname.options[i-1].value + ",";
|
||||
deleted_rejects[selname.options[i-1].value] = 1;
|
||||
selname.remove(i-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteNopreviewSelected() {
|
||||
selname = top.frames[list_frame].document.fSelectNopreview.selname;
|
||||
goneP = top.frames[button_frame].document.buttons.goneP;
|
||||
var p;
|
||||
var i;
|
||||
for (i=selname.options.length; i>0; i--) {
|
||||
if (selname.options[i-1].selected) {
|
||||
selname.options[i-1].selected = 0;
|
||||
goneP.value = goneP.value + selname.options[i-1].value + ",";
|
||||
deleted_nopreviews[selname.options[i-1].value] = 1;
|
||||
selname.remove(i-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteNocaptureSelected() {
|
||||
selname = top.frames[list_frame].document.fSelectNocapture.selname;
|
||||
goneC = top.frames[button_frame].document.buttons.goneC;
|
||||
var p;
|
||||
var i;
|
||||
for (i=selname.options.length; i>0; i--) {
|
||||
if (selname.options[i-1].selected) {
|
||||
selname.options[i-1].selected = 0;
|
||||
goneC.value = goneC.value + selname.options[i-1].value + ",";
|
||||
deleted_nocaptures[selname.options[i-1].value] = 1;
|
||||
selname.remove(i-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function loadSignons(){
|
||||
signon_mode = 0;
|
||||
top.frames[index_frame].document.open();
|
||||
top.frames[index_frame].document.write(
|
||||
"<body bgcolor='#c0c0c0'>" +
|
||||
"<table border=0 width='100%'>" +
|
||||
"<tr>" +
|
||||
"<td align='center' valign='middle' bgcolor='#ffffff'>" +
|
||||
"<font size='2' color='#666666'>" +
|
||||
"<b>Logons saved</b>" +
|
||||
"</font>" +
|
||||
"</td>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadRejects();' href=''>" +
|
||||
"<font size='2'>Logons not saved</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"<tr>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadNopreviews();' href=''>" +
|
||||
"<font size='2'>Forms not previewed</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadNocaptures();' href=''>" +
|
||||
"<font size='2'>Forms not saved</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"<td> </td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</body>"
|
||||
);
|
||||
top.frames[index_frame].document.close();
|
||||
|
||||
top.frames[title_frame].document.open();
|
||||
top.frames[title_frame].document.write
|
||||
(" Logon information that has been saved");
|
||||
top.frames[title_frame].document.close();
|
||||
|
||||
loadSignonsList();
|
||||
}
|
||||
|
||||
function loadSignonsList(){
|
||||
top.frames[list_frame].document.open();
|
||||
top.frames[list_frame].document.write(
|
||||
"<form name='fSelectSignon'>" +
|
||||
"<p>" +
|
||||
"<b>site:username</b>" +
|
||||
"<table border='0'>" +
|
||||
"<tr>" +
|
||||
"<td width='100%' valign='top'>" +
|
||||
"<center>" +
|
||||
"<p>" +
|
||||
"<select name='selname' size='10' multiple='multiple'> "
|
||||
);
|
||||
for (i=1; !(i>=signonList.length); i++) {
|
||||
if (!deleted_signons[i-1]) {
|
||||
top.frames[list_frame].document.write(signonList[i]);
|
||||
}
|
||||
}
|
||||
top.frames[list_frame].document.write(
|
||||
"</select>" +
|
||||
"</p>" +
|
||||
"</center>" +
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</p>" +
|
||||
"</form>"
|
||||
);
|
||||
top.frames[list_frame].document.close();
|
||||
}
|
||||
|
||||
function loadRejects(){
|
||||
signon_mode = 1;
|
||||
top.frames[index_frame].document.open();
|
||||
top.frames[index_frame].document.write(
|
||||
"<body bgcolor='#c0c0c0'>" +
|
||||
"<table border='0' width='100%'>" +
|
||||
"<tr>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadSignons();' href=''>" +
|
||||
"<font size='2'>Logons saved</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"<td align='center' valign='middle' bgcolor='#ffffff'>" +
|
||||
"<font size='2' color='#666666'>" +
|
||||
"<b>Logons not saved</b>" +
|
||||
"</font>" +
|
||||
"</td>" +
|
||||
"<td> </td>" +
|
||||
"</tr>" +
|
||||
"<tr>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadNopreviews();' href=''>" +
|
||||
"<font size='2'>Forms not previewed</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadNocaptures();' href=''>" +
|
||||
"<font size='2'>Forms not saved</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"<td> </td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</body>"
|
||||
);
|
||||
top.frames[index_frame].document.close();
|
||||
|
||||
top.frames[title_frame].document.open();
|
||||
top.frames[title_frame].document.write
|
||||
(" Sites for which logon information won't be saved");
|
||||
top.frames[title_frame].document.close();
|
||||
|
||||
loadRejectsList();
|
||||
}
|
||||
|
||||
function loadRejectsList(){
|
||||
top.frames[list_frame].document.open();
|
||||
top.frames[list_frame].document.write(
|
||||
"<form name='fSelectReject'>" +
|
||||
"<p>" +
|
||||
"<table border='0'>" +
|
||||
"<tr>" +
|
||||
"<td width='100%' valign='top'>" +
|
||||
"<center>" +
|
||||
"<p>" +
|
||||
"<select name='selname' size='10' multiple='multiple'> "
|
||||
);
|
||||
for (i=1; !(i>=rejectList.length); i++) {
|
||||
if (!deleted_rejects[i-1]) {
|
||||
top.frames[list_frame].document.write(rejectList[i]);
|
||||
}
|
||||
}
|
||||
top.frames[list_frame].document.write(
|
||||
"</select>" +
|
||||
"</p>" +
|
||||
"</center>" +
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</p>" +
|
||||
"</form>"
|
||||
);
|
||||
top.frames[list_frame].document.close();
|
||||
}
|
||||
|
||||
function loadNopreviews(){
|
||||
signon_mode = 2;
|
||||
top.frames[index_frame].document.open();
|
||||
top.frames[index_frame].document.write(
|
||||
"<body bgcolor='#c0c0c0'>" +
|
||||
"<table border='0' width='100%'>" +
|
||||
"<tr>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadSignons();' href=''>" +
|
||||
"<font size='2'>Logons saved</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadRejects();' href=''>" +
|
||||
"<font size='2'>Logons not saved</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"<tr>" +
|
||||
"<td align='center' valign='middle' bgcolor='#ffffff'>" +
|
||||
"<font size='2' color='#666666'>" +
|
||||
"<b>Forms not previewed</b>" +
|
||||
"</font>" +
|
||||
"</td>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadNocaptures();' href=''>" +
|
||||
"<font size='2'>Forms not saved</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"<td> </td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</body>"
|
||||
);
|
||||
top.frames[index_frame].document.close();
|
||||
|
||||
top.frames[title_frame].document.open();
|
||||
top.frames[title_frame].document.write
|
||||
(" Forms that won't be previewed before being pre-filled");
|
||||
top.frames[title_frame].document.close();
|
||||
|
||||
loadNopreviewsList();
|
||||
}
|
||||
|
||||
function loadNopreviewsList(){
|
||||
top.frames[list_frame].document.open();
|
||||
top.frames[list_frame].document.write(
|
||||
"<form name='fSelectNopreview'>" +
|
||||
"<p>" +
|
||||
"<table border='0'>" +
|
||||
"<tr>" +
|
||||
"<td width='100%' valign='top'>" +
|
||||
"<center>" +
|
||||
"<p>" +
|
||||
"<select name='selname' size='10' multiple='multiple'> "
|
||||
);
|
||||
for (i=1; !(i>=nopreviewList.length); i++) {
|
||||
if (!deleted_nopreviews[i-1]) {
|
||||
top.frames[list_frame].document.write(nopreviewList[i]);
|
||||
}
|
||||
}
|
||||
top.frames[list_frame].document.write(
|
||||
"</select>" +
|
||||
"</p>" +
|
||||
"</center>" +
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</p>" +
|
||||
"</form>"
|
||||
);
|
||||
top.frames[list_frame].document.close();
|
||||
}
|
||||
|
||||
function loadNocaptures(){
|
||||
signon_mode = 3;
|
||||
top.frames[index_frame].document.open();
|
||||
top.frames[index_frame].document.write(
|
||||
"<body bgcolor='#c0c0c0'>" +
|
||||
"<table border='0' width='100%'>" +
|
||||
"<tr>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadSignons();' href=''>" +
|
||||
"<font size='2'>Logons saved</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadRejects();' href=''>" +
|
||||
"<font size='2'>Logons not saved</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"<tr>" +
|
||||
"<td align='center' valign='middle' bgcolor='#c0c0c0'>" +
|
||||
"<a onclick='top.loadNopreviews();' href=''>" +
|
||||
"<font size='2'>Forms not previewed</font>" +
|
||||
"</a>" +
|
||||
"</td>" +
|
||||
"<td align='center' valign='middle' bgcolor='#ffffff'>" +
|
||||
"<font size='2' color='#666666'>" +
|
||||
"<b>Forms not saved</b>" +
|
||||
"</font>" +
|
||||
"</td>" +
|
||||
"<td> </td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</body>"
|
||||
);
|
||||
top.frames[index_frame].document.close();
|
||||
|
||||
top.frames[title_frame].document.open();
|
||||
top.frames[title_frame].document.write
|
||||
(" Forms that won't be saved");
|
||||
top.frames[title_frame].document.close();
|
||||
|
||||
loadNocapturesList();
|
||||
}
|
||||
|
||||
function loadNocapturesList(){
|
||||
top.frames[list_frame].document.open();
|
||||
top.frames[list_frame].document.write(
|
||||
"<form name='fSelectNocapture'>" +
|
||||
"<p>" +
|
||||
"<table border='0'>" +
|
||||
"<tr>" +
|
||||
"<td width='100%' valign='top'>" +
|
||||
"<center>" +
|
||||
"<p>" +
|
||||
"<select name='selname' size='10' multiple='multiple'> "
|
||||
);
|
||||
for (i=1; !(i>=nocaptureList.length); i++) {
|
||||
if (!deleted_nocaptures[i-1]) {
|
||||
top.frames[list_frame].document.write(nocaptureList[i]);
|
||||
}
|
||||
}
|
||||
top.frames[list_frame].document.write(
|
||||
"</select>" +
|
||||
"</p>" +
|
||||
"</center>" +
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</p>" +
|
||||
"</form>"
|
||||
);
|
||||
top.frames[list_frame].document.close();
|
||||
}
|
||||
|
||||
function loadButtons(){
|
||||
top.frames[button_frame].document.open();
|
||||
top.frames[button_frame].document.write(
|
||||
"<form name='buttons'>" +
|
||||
"<br/>" +
|
||||
" " +
|
||||
"<button onclick='top.DeleteItemSelected();'>Remove</button>" +
|
||||
"<div align='right'>" +
|
||||
"<button onclick='parent.Save();'>OK</button>" +
|
||||
" " +
|
||||
"<button onclick='parent.Cancel();'>Cancel</button>" +
|
||||
"</div>" +
|
||||
"<input type='hidden' name='goneS' value='' size='-1'/>" +
|
||||
"<input type='hidden' name='goneR' value='' size='-1'/>" +
|
||||
"<input type='hidden' name='goneP' value='' size='-1'/>" +
|
||||
"<input type='hidden' name='goneC' value='' size='-1'/>" +
|
||||
"<input type='hidden' name='signonList' value='' size='-1'/>" +
|
||||
"<input type='hidden' name='rejectList' value='' size='-1'/>" +
|
||||
"</form>"
|
||||
);
|
||||
top.frames[button_frame].document.close();
|
||||
}
|
||||
|
||||
function loadFrames(){
|
||||
list = DoGetSignonList();
|
||||
BREAK = list[0];
|
||||
signonList = list.split(BREAK);
|
||||
list = DoGetRejectList();
|
||||
BREAK = list[0];
|
||||
rejectList = list.split(BREAK);
|
||||
list = DoGetNopreviewList();
|
||||
BREAK = list[0];
|
||||
nopreviewList = list.split(BREAK);
|
||||
list = DoGetNocaptureList();
|
||||
BREAK = list[0];
|
||||
nocaptureList = list.split(BREAK);
|
||||
loadSignons();
|
||||
loadButtons();
|
||||
}
|
||||
|
||||
function Save(){
|
||||
var goneS = top.frames[button_frame].document.buttons.goneS;
|
||||
var goneR = top.frames[button_frame].document.buttons.goneR;
|
||||
var goneP = top.frames[button_frame].document.buttons.goneP;
|
||||
var goneC = top.frames[button_frame].document.buttons.goneC;
|
||||
var result = "|goneS|"+goneS.value+"|goneR|"+goneR.value;
|
||||
result += "|goneC|"+goneC.value+"|goneP|"+goneP.value+"|";
|
||||
DoSave(result);
|
||||
}
|
||||
|
||||
function Cancel(){
|
||||
var result = "|goneS||goneR||goneC||goneP||";
|
||||
DoSave(result);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<frameset rows = "30,10,125,50" border="0" framespacing="0" onload="loadFrames();">
|
||||
<frame src="about:blank"
|
||||
id="index_frame"
|
||||
scrolling="no"
|
||||
marginwidth="1"
|
||||
marginheight="1"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
id="title_frame"
|
||||
scrolling="no"
|
||||
marginwidth="1"
|
||||
marginheight="1"
|
||||
noresize="noresize"/>
|
||||
<frameset cols="5,*,5" border="0" framespacing="0">
|
||||
<frame src="about:blank"
|
||||
id="spacer1_frame"
|
||||
scrolling="AUTO"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
id="list_frame"
|
||||
scrolling="auto"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
id="spacer2_frame"
|
||||
scrolling="auto"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
noresize="noresize"/>
|
||||
</frameset>
|
||||
<frame src="about:blank"
|
||||
id="button_frame"
|
||||
scrolling="no"
|
||||
marginwidth="1"
|
||||
marginheight="1"
|
||||
noresize="noresize"/>
|
||||
</frameset>
|
||||
|
||||
<noframes>
|
||||
<body> <p></p> </body>
|
||||
</noframes>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
@ -1,172 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Pre-Filling</title>
|
||||
<script>
|
||||
|
||||
/* for xpconnect */
|
||||
var walletpreview =
|
||||
Components.classes
|
||||
["@mozilla.org/walletpreview/walletpreview-world;1"].createInstance();
|
||||
walletpreview = walletpreview.QueryInterface(Components.interfaces.nsIWalletPreview);
|
||||
|
||||
function DoGetPrefillList()
|
||||
{
|
||||
return walletpreview.GetPrefillValue();
|
||||
}
|
||||
|
||||
function DoSave(value)
|
||||
{
|
||||
walletpreview.SetValue(value, window);
|
||||
}
|
||||
/* end of xpconnect stuff */
|
||||
|
||||
index_frame = 0;
|
||||
title_frame = 1;
|
||||
list_frame = 2;
|
||||
button_frame = 3;
|
||||
var prefillList = [];
|
||||
|
||||
function loadFillins(){
|
||||
top.frames[title_frame].document.open();
|
||||
top.frames[title_frame].document.write
|
||||
(" Following items can be pre-filled for you.");
|
||||
top.frames[title_frame].document.close();
|
||||
|
||||
top.frames[list_frame].document.open();
|
||||
top.frames[list_frame].document.write(
|
||||
"<form name='fSelectFillin'>" +
|
||||
"<br/>" +
|
||||
"<table border='0'>" +
|
||||
"<tr>" +
|
||||
"<td>" +
|
||||
"<br/>"
|
||||
)
|
||||
var count;
|
||||
for (i=1; !(i>=prefillList.length-2); i+=3) {
|
||||
if(prefillList[i] != 0) {
|
||||
count = prefillList[i];
|
||||
top.frames[list_frame].document.write(
|
||||
"<tr>" +
|
||||
"<td>" + prefillList[i+1] + ": </td>" +
|
||||
"<td>" +
|
||||
"<select>"
|
||||
)
|
||||
count--;
|
||||
}
|
||||
top.frames[list_frame].document.write(
|
||||
"<option VALUE='"+prefillList[i+1]+"'>" +
|
||||
prefillList[i+2] +
|
||||
"</option>"
|
||||
)
|
||||
if(count == 0) {
|
||||
top.frames[list_frame].document.write(
|
||||
"<option VALUE='"+prefillList[i+1]+"'><do not prefill></option>" +
|
||||
"</select><br/>" +
|
||||
"</td>" +
|
||||
"</tr>"
|
||||
)
|
||||
}
|
||||
}
|
||||
top.frames[list_frame].document.write(
|
||||
"</td>" +
|
||||
"</tr>" +
|
||||
"</table>" +
|
||||
"</form>"
|
||||
);
|
||||
top.frames[list_frame].document.close();
|
||||
};
|
||||
|
||||
function loadButtons(){
|
||||
top.frames[button_frame].document.open();
|
||||
top.frames[button_frame].document.write(
|
||||
"<form name=buttons>" +
|
||||
"<br/>" +
|
||||
"<input type='checkbox' name='skip'> " +
|
||||
"Bypass this screen when prefilling this form in the future" +
|
||||
"</input> " +
|
||||
"<br/>" +
|
||||
"<br/>" +
|
||||
"<div align='center'>" +
|
||||
"<button onclick='parent.Save();'>OK</button>" +
|
||||
" " +
|
||||
"<button onclick='parent.Cancel();'>Cancel</button>" +
|
||||
"</div>" +
|
||||
"<input type='hidden' name='fillins' value=' ' size='-1'>" +
|
||||
"<input type='hidden' name='list' value=' ' size='-1'>" +
|
||||
"<input type='hidden' name='url' value=' ' size='-1'>" +
|
||||
"</form>"
|
||||
);
|
||||
top.frames[button_frame].document.close();
|
||||
}
|
||||
|
||||
function loadFrames(){
|
||||
list = DoGetPrefillList();
|
||||
BREAK = list[0];
|
||||
prefillList = list.split(BREAK);
|
||||
loadFillins();
|
||||
loadButtons();
|
||||
}
|
||||
|
||||
function Save(){
|
||||
selname = top.frames[list_frame].document.fSelectFillin;
|
||||
var list = top.frames[button_frame].document.buttons.list;
|
||||
var url = top.frames[button_frame].document.buttons.url;
|
||||
var skip = top.frames[button_frame].document.buttons.skip;
|
||||
list.value = prefillList[prefillList.length-2];
|
||||
url.value = prefillList[prefillList.length-1];
|
||||
var fillins = top.frames[button_frame].document.buttons.fillins;
|
||||
fillins.value = "";
|
||||
for (i=0; !(i>=selname.length); i++) {
|
||||
fillins.value = fillins.value +
|
||||
selname.elements[i].options[selname.elements[i].selectedIndex].value + "#*%$" +
|
||||
selname.elements[i].options[selname.elements[i].selectedIndex].text + "#*%$";
|
||||
}
|
||||
var result = "|list|"+list.value+"|fillins|"+fillins.value;
|
||||
result += "|url|"+url.value+"|skip|"+skip.checked+"|";
|
||||
DoSave(result);
|
||||
}
|
||||
|
||||
function Cancel(){
|
||||
selname = top.frames[list_frame].document.fSelectFillin;
|
||||
var list = top.frames[button_frame].document.buttons.list;
|
||||
list.value = prefillList[prefillList.length-2];
|
||||
var result = "|list|"+list.value+"|fillins||url||skip|false|";
|
||||
DoSave(result);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<frameset rows = "15,25,100,75"
|
||||
border="0"
|
||||
framespacing="0"
|
||||
onload="loadFrames();">
|
||||
<frame src="about:blank"
|
||||
name="index_frame"
|
||||
scrolling="no"
|
||||
marginwidth="1"
|
||||
marginheight="1"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
name="title_frame"
|
||||
scrolling="no"
|
||||
marginwidth="1"
|
||||
marginheight="1"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
name="list_frame"
|
||||
scrolling="auto"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
noresize="noresize"/>
|
||||
<frame src="about:blank"
|
||||
name="button_frame"
|
||||
scrolling="no"
|
||||
marginwidth="1"
|
||||
marginheight="1"
|
||||
noresize="noresize"/>
|
||||
</frameset>
|
||||
|
||||
<noframes>
|
||||
<body> <br/> </body>
|
||||
</noframes>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user