Skip to content

Commit

Permalink
Fixes for web_accessible_resources sample. (GoogleChrome#946)
Browse files Browse the repository at this point in the history
* Fixes for web_accessible_resources sample.

* Address feedback.
  • Loading branch information
oliverdunk authored Jun 7, 2023
1 parent 2a89694 commit 178e272
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 134 deletions.
14 changes: 14 additions & 0 deletions api-samples/web-accessible-resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Web Accessible Resources

This sample demonstrates using the [web_accessible_resources](https://developer.chrome.com/docs/extensions/mv3/manifest/web_accessible_resources/)
key in the manifest.json file to control access to assets within an extension.

## Overview

This sample shows how image assets within an extension can be exposed to pages on the web.

## Running this extension

1. Clone this repository.
2. Load this directory in Chrome as an [unpacked extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked).
3. Follow the instructions on the newly opened tab.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Web Accessible Resources - Readme</title>
<title>Web Accessible Resources</title>
<style>
body {
font-family: Helvetica, Arial, sans-serif;
Expand Down Expand Up @@ -35,7 +35,7 @@ <h1>Web Accessible Resources Demo</h1>
do this, we define a set of
<a
href="https://developer.chrome.com/docs/extensions/mv3/manifest/web_accessible_resources/"
><code>"web_accessable_resources"</code></a
><code>"web_accessible_resources"</code></a
>
in our <a href="manifest.json">manifest.json</a>. This object specifies
what assets should be accessible to which external resources.
Expand Down
2 changes: 1 addition & 1 deletion api-samples/web-accessible-resources/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0",
"manifest_version": 3,
"background": {
"service_worker": "background.js"
"service_worker": "service-worker.js"
},
"action": {},
"content_scripts": [
Expand Down
129 changes: 0 additions & 129 deletions api-samples/web-accessible-resources/readme.css

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ chrome.action.onClicked.addListener(() => {
});

function showReadme() {
const url = chrome.runtime.getURL('readme.html');
chrome.tabs.create({ url });
chrome.tabs.create({ url: '/index.html' });
}

0 comments on commit 178e272

Please sign in to comment.