How to get registered into GCM topics from javascript (for Chrome)
<p><a href="https://developers.google.com/web/fundamentals/getting-started/?hl=en" rel="nofollow">Here</a> is a nice documentation on how to implement Google Cloud Messaging (GCM) in Chrome. But I do not found any reference here or anywhere how to subscribe to a topic using javascript (for Chrome).</p>

<p>Here I have found a reference how to do the task for Android:
<a href="https://developers.google.com/cloud-messaging/topic-messaging#subscribe-to-a-topic" rel="nofollow">https://developers.google.com/cloud-messaging/topic-messaging#subscribe-to-a-topic</a></p>

<p>Java code(Android) for subscribe to a topic in GCM:</p>

<pre><code>private void subscribeTopics(String token) throws IOException {
    GcmPubSub pubSub = GcmPubSub.getInstance(this);
    for (String topic : TOPICS) {
        pubSub.subscribe(token, "/topics/" + topic, null);
    }
}
</code></pre>

<p><strong>WHAT I AM NOT LOOKING FOR</strong> </p>

<p>I am NOT looking ways for Chrome app/Extension.</p>

<p><strong>WHAT DO I WANT</strong></p>

<p><strong><em>I want to send push notification to all my users.</em></strong> So far I know this can be achievable in two ways:</p>

<ol>
<li>Push message to a topic </li>
<li>Or I have to: "You need to send the list of reg id of devices and also this list should not exceed 1000 this is a limitation of GCM if you want to send message to more than 1000 devices then you need to break the list in chunks of 1000."</li>
</ol>

<p>I want to avoid point number 2.</p>

<p><strong>MY QUESTION</strong></p>

<p>So, My question is is there any way to subscribe to a topic for GCM using Javascript for Chrome browser (for web pages)? If there, then how to do that?</p>