You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All the params from each widget are being appended to the URL that is being used by the button for the sharing call: https://github.com/NikolayRys/Likely/blob/master/source/button.js#L216
As I understand, this has been done to unify the way the URL build between all the services.
The problem
This approach doesn't make much sense. Each service constructs the URL in each own way, knows a finite list of parameters, or doesn't use different parameters at all.
This leads to the creation of nonsensical URLs.
It prevents using custom parameters as to "disable counter" or "default message" for each of the services since they will mess with URL creation.
It makes adding new services more difficult.
Proposed solution
Initial change for 2.5:
Add a concept of "known params" for each service. For example, "data-via", but not "data-hello" to Twitter. Continue attaching all the parameters to the URL, but throw console warning each time the parameter not recognised.
Breaking change for 3.0:
Remove the shared logic of constructing URL out of all provided parameters. Instead, do a custom thing in each service according to its capabilities.
Expand the list of known params. Introduce the difference between obligatory params and known, but not obligatory.
Remove warning.
The text was updated successfully, but these errors were encountered:
@vitkarpov Could you please share your opinion on this? I'm afraid that somebody might be using this to achieve something.
Like so: <div class="twitter" data-hello="goodbye">Tweet</div>
that changes URL to: https://twitter.com/intent/tweet?url={url}&text={title}&hello=goodbye
NikolayRys
changed the title
Improve parameters interpretation
Improve interpretation of attributes
Apr 20, 2020
Status quo
All the params from each widget are being appended to the URL that is being used by the button for the sharing call:
https://github.com/NikolayRys/Likely/blob/master/source/button.js#L216
As I understand, this has been done to unify the way the URL build between all the services.
The problem
This approach doesn't make much sense. Each service constructs the URL in each own way, knows a finite list of parameters, or doesn't use different parameters at all.
Proposed solution
Initial change for 2.5:
Add a concept of "known params" for each service. For example, "data-via", but not "data-hello" to Twitter. Continue attaching all the parameters to the URL, but throw console warning each time the parameter not recognised.
Breaking change for 3.0:
Remove the shared logic of constructing URL out of all provided parameters. Instead, do a custom thing in each service according to its capabilities.
Expand the list of known params. Introduce the difference between obligatory params and known, but not obligatory.
Remove warning.
The text was updated successfully, but these errors were encountered: