Skip to content

Commit

Permalink
add externally_connectable to manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
godd9170 committed Jan 17, 2017
1 parent 51b6408 commit 8ee8dd4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
31 changes: 14 additions & 17 deletions content/src/scripts/components/app/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,27 @@ class App extends Component {
super(props);
}

// componentDidMount() {
// document.addEventListener('click', () => {
// console.log('gmail: ', this.props.gmail);
// console.log('email: ', this.props.gmail.get.user_email());
// this.props.dispatch({
// type: 'ADD_COUNT'
// });
// });
// }
componentDidMount() {
document.addEventListener('click', () => {
this.props.dispatch({
type: 'ADD_COUNT'
});
});
}

render() {
return (
<div>
{this.props.gmail.get.user_email()}
{this.props.gmail.get.user_email()}: {this.props.count}
</div>
);
}
}

// const mapStateToProps = (state) => {
// return {
// count: state.count
// };
// };
const mapStateToProps = (state) => {
return {
count: state.count
};
};

// export default connect(mapStateToProps)(App);
export default App;
export default connect(mapStateToProps)(App);
2 changes: 1 addition & 1 deletion content/src/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $('<div id="rcr-anchor"></div>').appendTo(mainPanel); //Bind anchor to main pane



const proxyStore = new Store('iagdjhocgbkfdahcdegiachcdhkggfob', {portName: 'example'});
const proxyStore = new Store({portName: 'example', 'extensionId' : 'iagdjhocgbkfdahcdegiachcdhkggfob' });



Expand Down
16 changes: 15 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,19 @@
"jquery-1.10.2.min.js",
"gmail.js",
"main.js"
]
],
"externally_connectable": {
// Extension and app IDs. If this field is not specified, no
// extensions or apps can connect.
"ids": ["*"],
// Match patterns for web pages. Does not affect content scripts.
// If this field is not specified, no webpages can connect.
"matches": ["*://mail.google.com/*"],
// Indicates that the extension would like to make use of the TLS
// channel ID of the web page connecting to it. The web page must
// also opt to send the TLS channel ID to the extension via setting
// includeTlsChannelId to true in runtime.connect's connectInfo
// or runtime.sendMessage's options.
"accepts_tls_channel_id": true
}
}

0 comments on commit 8ee8dd4

Please sign in to comment.