mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 14:59:12 +02:00
New user script example (#438)
* New user script example This PR is the content from [PR 426](https://github.com/mdn/webextensions-examples/pull/426), originally submitted by Irene, addressing the feedback on the readme content. * Including the following changes: * renaming the content script example and updating the readme file to reference the user script example * renaming the user script example and versioning as v1 * addressing feedback on the user script example: limiting input to hosts and script, addressing code and HTML/CSS comments I haven't changed the "eating" script example, I feel it is useful to have similar demonstrations in the content and user script examples to make it easier for developers to compare and contrast. * Various changes for feedback * Added a user script ID that is stored in the registered script's metadata and then used in the API script to key the data stored in local storage * Update to emphasize scoping of local storage using an ID provided in the user script metadata Co-authored-by: Richard Bloor <rbloor@atlassian.com>
This commit is contained in:
@@ -94,6 +94,15 @@
|
||||
],
|
||||
"name": "commands"
|
||||
},
|
||||
{
|
||||
"description": "Illustrates how an extension can register URL-matching content scripts at runtime.",
|
||||
"javascript_apis": [
|
||||
"contentScripts.register",
|
||||
"runtime.onMessage",
|
||||
"runtime.sendMessage"
|
||||
],
|
||||
"name": "content-script-register"
|
||||
},
|
||||
{
|
||||
"description": "Add a context menu option to links to copy the link to the clipboard, as plain text and as a link in rich HTML.",
|
||||
"javascript_apis": [
|
||||
@@ -546,13 +555,13 @@
|
||||
"name": "user-agent-rewriter"
|
||||
},
|
||||
{
|
||||
"description": "Illustrates how an extension can register URL-matching content scripts at runtime.",
|
||||
"description": "Illustrates how an extension can register URL-matching user scripts at runtime.",
|
||||
"javascript_apis": [
|
||||
"contentScripts.register",
|
||||
"userScripts.register",
|
||||
"runtime.onMessage",
|
||||
"runtime.sendMessage"
|
||||
],
|
||||
"name": "user-script"
|
||||
"name": "user-script-register"
|
||||
},
|
||||
{
|
||||
"description": "Demonstrates how to use webpack to package npm modules in an extension.",
|
||||
|
||||
Reference in New Issue
Block a user