Set text for google + link with javascript

I want to open google sharing dialog with some data, I am using this for now:

var GOOGLE_BASE_URL = "https://plus.google.com/share?url="; url += GOOGLE_BASE_URL + urlToShare; window.open(url, null, DIMENSIONS); 

How to set the text to be inserted in the comments section?

+4
source share
2 answers

The only way to pre-populate the promotion text is to use Interactive Messages instead of a shared link. This is the feature that comes with Google+ Sign-In . This may not be the best solution for you if you are trying to use a generic approach. However, if you are already using Google as an authentication method, then it may be a good opportunity for you to sign in to Google+. Interactive messages allow not only pre-filling the text, but also filling up to 10 recipients of this promotion, and all of them will be directly notified about it.

+5
source

From the documentation :

The Google+ sharing endpoint accepts the following request parameters:

 Parameter Description url The URL of the page to share. This value should be url encoded. hl The language code for the locale to use on the Google+ sharing page. 

Google does not provide the page author with the ability to specify a comment that the user must make about the link.

So you cannot.

+4
source

Source: https://habr.com/ru/post/1500809/


All Articles