-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Conversation
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
/to camelburrito lannka
For any issues please file a bug at https://github.com/google/github-owners-bot/issues |
if (message.type == MessageType.REQUEST) { | ||
this.handleRequest_(message); | ||
this.handleRequest_(/** @type {Message} */(message)); |
There was a problem hiding this comment.
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 = ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
examples/viewer-integr-messaging.js
Outdated
@@ -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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…ct#8165) * stringify webview messages * check-types fix * in progress * test fix * cleanup * cleanup * fixes * fix viewer2.html * fixes * remove console.log
amp-viewer-integration:
The messages from the webview arrive as strings. Support this.
close #8182