Skip to content

Commit

Permalink
update to latest app-shell
Browse files Browse the repository at this point in the history
- default tag for non-Product views is now browserContext
  • Loading branch information
smalls committed Nov 15, 2017
1 parent c37a03c commit 27fc8b8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
6 changes: 5 additions & 1 deletion extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,16 @@ event-page.js#filterResponse(). Notable inclusions are
[Product](https://schema.org/Product) and [Event](https://schema.org/Event),
but check the code for the authoritative list.

The extension automatically tags [Product] with #shortlist.
The extension automatically tags [Product] with #shortlist, and all other
views with #browserContext.

## todos

Nothing is ever complete.

- [ ] Views should be created in the user's profile, so they can be consumed
in other arcs (and as they aren't meant to be shared to other users by
default).
- [ ] When initializing the extension, pull in data from all open tabs. The
current version depends on the extension being on from browser startup, and
there's a hook from each tab that's opened to send over entities from that
Expand Down
2 changes: 1 addition & 1 deletion extension/communicate-to-arcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function _getUrl(cdnRoot, arcManifest, response) {
function populateIframe(doc) {

var iframe = doc.getElementById('arcs-if');
let cdnApp = cdn + '/app/';
let cdnApp = cdn + '/apps/chrome-extension/';
var newPageLink = doc.getElementById('ext-new-page');
var reinitLink = doc.getElementById('ext-reinit');
var displayAmKey = doc.getElementById('ext-amkey');
Expand Down
3 changes: 2 additions & 1 deletion extension/event-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<script src="https://www.gstatic.com/firebasejs/4.2.0/firebase-database.js"></script>

<script src="https://polymerlabs.github.io/arcs-cdn/dev/lib/ArcsLib.js"></script>
<link rel="import" href="https://polymerlabs.github.io/arcs-cdn/dev/components/metadata-storage.html">
<script src="https://polymerlabs.github.io/arcs-cdn/dev/app-shell/lib/firebase.js"></script>
<script src="https://polymerlabs.github.io/arcs-cdn/dev/app-shell/lib/metadata-storage.js"></script>


<script src="globals.js"></script>
Expand Down
6 changes: 4 additions & 2 deletions extension/event-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function init() {

// The goal here is that this list contains all known schema
manifest = await Arcs.Manifest.parse(`
import '${cdn}/entities/entities.manifest'`,
import '${cdn}/artifacts/Products/Product.schema'`,
{fileName: 'inline', path: 'inline', loader: loader});
arc = new Arcs.Arc({id: 'browser/'+chrome.runtime.id, context: manifest});
ams = new ArcMetadataStorage({arc: arc});
Expand Down Expand Up @@ -154,9 +154,11 @@ function updateArc(tabId, response) {

viewType = new Arcs.Type('list', entityClass.type);

let viewTag = shortTypeName=='Product' ? 'shortlist' : 'browserContext';

viewId = 'Browser/'+tabId+'/'+shortTypeName;
view = arc.createView(viewType, 'Browser tab '+tabId+' type '+shortTypeName,
viewId, ['shortlist']);
viewId, [viewTag]);

// need to push entity
arc.commit([entity]);
Expand Down
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
"browser_action": {
"default_popup": "popup.html"
},
"content_security_policy": "script-src 'self' https://polymerlabs.github.io/ https://www.gstatic.com/ https://*.firebaseio.com/ 'sha256-rdk56h4D+jfInKWMNE+DL5C923/KiX9j3/l0Cdvgj0c=' 'sha256-UhKb6ALfS/wBC46s4Gf/MkECcgTkd8muXg/DEdOKuwY=' 'sha256-mpv4jXBf67t0vGyjzIY7oBlP/WKz7QG//3pkwtSJp2c='; object-src 'self'"
"content_security_policy": "script-src 'self' https://polymerlabs.github.io/ https://www.gstatic.com/ https://*.firebaseio.com/ 'sha256-rdk56h4D+jfInKWMNE+DL5C923/KiX9j3/l0Cdvgj0c=' 'sha256-UhKb6ALfS/wBC46s4Gf/MkECcgTkd8muXg/DEdOKuwY='; object-src 'self'"
}

0 comments on commit 27fc8b8

Please sign in to comment.