Chromium Code Reviews| Index: chrome/common/extensions/docs/examples/api/contentSettings/popup.html |
| diff --git a/chrome/common/extensions/docs/examples/api/contentSettings/popup.html b/chrome/common/extensions/docs/examples/api/contentSettings/popup.html |
| index da68f3e5f57d85afed7661293b0f43eadf1c470c..a340ce466f9c4838d965783b7bd5ce1b097fecf9 100644 |
| --- a/chrome/common/extensions/docs/examples/api/contentSettings/popup.html |
| +++ b/chrome/common/extensions/docs/examples/api/contentSettings/popup.html |
| @@ -1,86 +1,53 @@ |
| <!DOCTYPE html> |
| <html> |
| -<head> |
| -<script> |
| -var incognito; |
| -var url; |
| + <head> |
| + <title>Popup</title> |
| + <script src="./popup.js"></script> |
|
Boris Smus
2011/10/18 21:51:38
Equivalent to "popup.js". Only mention it because
Mike West
2011/10/19 09:43:57
Done.
|
| + </head> |
| + <body> |
| + <fieldset> |
| + <dl> |
| + <dt><label for="cookies">Cookies: </label></dt> |
| + <dd><select id="cookies"> |
| + <option value="allow">Allow</option> |
| + <option value="session_only">Session only</option> |
| + <option value="block">Block</option> |
| + </select></dd> |
| + <dt><label for="images">Images: </label></dt> |
| + <dd><select id="images"> |
| + <option value="allow">Allow</option> |
| + <option value="block">Block</option> |
| + </select> |
| + <dt><label for="javascript">Javascript: </label></dt> |
| + <dd><select id="javascript"> |
| + <option value="allow">Allow</option> |
| + <option value="block">Block</option> |
| + </select></dd> |
| + <dt><label for="plugins">Plug-ins: </label></dt> |
| + <dd><select id="plugins"> |
| + <option value="allow">Allow</option> |
| + <option value="block">Block</option> |
| + </select></dd> |
| + <dt><label for="popups">Pop-ups: </label></dt> |
| + <dd><select id="popups"> |
| + <option value="allow">Allow</option> |
| + <option value="block">Block</option> |
| + </select></dd> |
| + <dt><label for="location">Location: </label></dt> |
| + <dd><select id="location" disabled> |
| + <option value="allow">Allow</option> |
| + <option value="ask">Ask</option> |
| + <option value="block">Block</option> |
| + </select></dd> |
| + <dt><label for="notifications">Notifications: </label></dt> |
| + <dd><select id="notifications"> |
| + <option value="allow">Allow</option> |
| + <option value="ask">Ask</option> |
| + <option value="block">Block</option> |
| + </select></dd> |
| + </dl> |
| + </fieldset> |
| -function init() { |
| - chrome.tabs.getSelected(undefined, function(tab) { |
| - incognito = tab.incognito; |
| - url = tab.url; |
| - var types = ["cookies", "images", "javascript", "plugins", "popups", |
| - "notifications"]; |
| - types.forEach(function(type) { |
| - chrome.contentSettings[type].get({ |
| - 'primaryUrl': url, |
| - 'incognito': incognito |
| - }, |
| - function(details) { |
| - document.getElementById(type).value = details.setting; |
| - }); |
| - }); |
| - }); |
| -} |
| -function settingChanged(element) { |
| - var type = element.id; |
| - var setting = element.value; |
| - var pattern = /^file:/.test(url) ? url : url.replace(/\/[^\/]*?$/, '/*'); |
| - console.log(type+" setting for "+pattern+": "+setting); |
| - chrome.contentSettings[type].set({ |
| - 'primaryPattern': pattern, |
| - 'setting': setting, |
| - 'scope': (incognito ? 'incognito_session_only' : 'regular') |
| - }); |
| -} |
| -</script> |
| -</head> |
| -<body onload="init()"> |
| - |
| -<fieldset> |
| -<dl> |
| -<dt><label for="cookies">Cookies: </label></dt> |
| -<dd><select id="cookies" onchange="settingChanged(this);"> |
| - <option value="allow">Allow</option> |
| - <option value="session_only">Session only</option> |
| - <option value="block">Block</option> |
| -</select></dd> |
| -<dt><label for="images">Images: </label></dt> |
| -<dd><select id="images" onchange="settingChanged(this);"> |
| - <option value="allow">Allow</option> |
| - <option value="block">Block</option> |
| -</select> |
| -<dt><label for="javascript">Javascript: </label></dt> |
| -<dd><select id="javascript" onchange="settingChanged(this);"> |
| - <option value="allow">Allow</option> |
| - <option value="block">Block</option> |
| -</select></dd> |
| -<dt><label for="plugins">Plug-ins: </label></dt> |
| -<dd><select id="plugins" onchange="settingChanged(this);"> |
| - <option value="allow">Allow</option> |
| - <option value="block">Block</option> |
| - </select></dd> |
| -<dt><label for="popups">Pop-ups: </label></dt> |
| -<dd><select id="popups" onchange="settingChanged(this);"> |
| - <option value="allow">Allow</option> |
| - <option value="block">Block</option> |
| - </select></dd> |
| -<dt><label for="location">Location: </label></dt> |
| -<dd><select id="location" onchange="settingChanged(this);" disabled> |
| - <option value="allow">Allow</option> |
| - <option value="ask">Ask</option> |
| - <option value="block">Block</option> |
| - </select></dd> |
| -<dt><label for="notifications">Notifications: </label></dt> |
| -<dd><select id="notifications" onchange="settingChanged(this);"> |
| - <option value="allow">Allow</option> |
| - <option value="ask">Ask</option> |
| - <option value="block">Block</option> |
| - </select></dd> |
| -</dl> |
| -</fieldset> |
| - |
| - |
| -</body> |
| + </body> |
| </html> |