access element

By Opera Software

From Opera 15 onward, Opera 11 & 12’s extension format is no longer supported, and instead, we’ve switched to Chromium’s extension model. Check out our new documentation for developing extensions for Opera 15 and higher and start building your own extensions.

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>

This article is licensed under a Creative Commons Attribution 3.0 Unported license.

Comments

  • photo

    Rob W

    Friday, January 11, 2013

    Pay attention to the spelling of the attribute, it's plural "subdomainS".

    It took some time to discover this because the add-on INSTALLS JUST FINE WITHOUT ANY ERRORS, but addons.opera.com will reject it with the unhelpful message "Your config.xml does not comply with the W3C Widget Packaging and XML Configuration specification. Please correct it and try uploading again."
No new comments accepted.