Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amp-viewer-integration support string messages from webview #8165

Merged
merged 10 commits into from Mar 16, 2017

Conversation

chenshay
Copy link
Contributor

@chenshay chenshay commented Mar 15, 2017

amp-viewer-integration:
The messages from the webview arrive as strings. Support this.

close #8182

@chenshay chenshay changed the title do not subiWebview do not submit - Webview Mar 15, 2017
@chenshay chenshay changed the title do not submit - Webview do not submit - amp-viewer-integration support string messages from webview Mar 15, 2017
@ampprojectbot
Copy link
Member

Hi, ampproject bot here! Here are a list of the owners that can approve your files.

You may leave an issue comment stating "@ampprojectbot retry!" to force me to re-evaluate this Pull Request's status

/to cramforce dvoytenko jridgewell

  • extensions/amp-viewer-integration/0.1/amp-viewer-integration.js
  • extensions/amp-viewer-integration/0.1/messaging.js
  • extensions/amp-viewer-integration/0.1/test/webview-viewer-for-testing.js

/to camelburrito lannka

  • examples/viewer-integr-messaging.js
  • examples/viewer2.html

For any issues please file a bug at https://github.com/google/github-owners-bot/issues

@chenshay chenshay changed the title do not submit - amp-viewer-integration support string messages from webview amp-viewer-integration support string messages from webview Mar 15, 2017
@chenshay chenshay requested a review from dvoytenko March 15, 2017 23:05
if (message.type == MessageType.REQUEST) {
this.handleRequest_(message);
this.handleRequest_(/** @type {Message} */(message));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move cast above to const message = ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -31,18 +31,19 @@ var APP = '__AMPHTML__';
* https://developer.mozilla.org/en-US/docs/Web/API/Channel_Messaging_API
*/
class WindowPortEmulator {
constructor(messageHandlers, id, port) {
constructor(messageHandlers, id, port, opt_isWebview) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual code below is preferred. There you only use pass isWebview to the Messaging class. It'd be better here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@chenshay chenshay merged commit b4b93e0 into ampproject:master Mar 16, 2017
@chenshay chenshay deleted the webview branch March 16, 2017 17:20
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
…ct#8165)

* stringify webview messages

* check-types fix

* in progress

* test fix

* cleanup

* cleanup

* fixes

* fix viewer2.html

* fixes

* remove console.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

amp-viewer-integration webview messages are passed as strings
3 participants