Skip to content

Instantly share code, notes, and snippets.

@rpl
Created April 4, 2022 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpl/0f8f5a6fb88a1c0a214738ad0bcf81bd to your computer and use it in GitHub Desktop.
Save rpl/0f8f5a6fb88a1c0a214738ad0bcf81bd to your computer and use it in GitHub Desktop.
Self-distribuited addon install test page
<!DOCTYPE html>
<html>
<head>
<title>Self-distribuited addon install</title>
<meta charset="utf-8">
</head>
<body>
<h1>Self-distribuited addon install</h1>
<h2>Supported install flow examples</h2>
<h3>1) Link to xpi url (no JS)</h3>
<div id="example-option-1" class="install-ok">
<a href="https://addons.mozilla.org/firefox/downloads/file/3923300/facebook_container-2.3.2-fx.xpi">
Install add-on by clicking here
</a>
</div>
<h3>2) Navigate to xpi url from JS code (executed from inside a callback that is handling user input)</h3>
<div id="example-option-2" class="install-ok">
<button>
Install add-on by clicking here
</button>
<script>
document.querySelector("#example-option-2 > button").onclick = () => {
window.location = "https://addons.mozilla.org/firefox/downloads/file/3923300/facebook_container-2.3.2-fx.xpi";
};
</script>
</div>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment