Developers › Dev.Opera

access element

December 6, 2011 · by Opera Software

Description

The <access> element allows authors permission to access external web resources. If the background process needs anything to load from outside the extension (like a web resource) then it needs to be specified in this element. If the extension needs to share cookies with a web domain, that also needs to be specified in the <access> element. The following attributes are associated with it.

  • origin: Specifies the domain part of a URL whose resources need to be fetched; you can use an asterisk (*) to specify unrestricted access to network resources
  • subdomains: Specifies whether the access requests are also valid on subdomains or not; it is a boolean, with valid values as "true" or "false".

Examples

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" id="http://example.com/myExtension" version="1.0">
 ...
   <access origin="https://example.com"/>
 ...
</widget>
<?xml version="1.0" encoding="utf-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" id="http://example.com/myExtension" version="1.0">
 ...
  <access origin="https://example.com" subdomains="true" />
 ...
</widget>

About this article

Published inDev.Opera
DateDecember 6, 2011
AuthorOpera Software
Tagsconfig.xml, extensions API
OriginalInternet Archive