Nettoyer le code JS des bookmarklets #1

Closed
opened 2017-01-16 17:33:53 +01:00 by Shikiryu · 0 comments
Owner

Sans HTML, quelque chose comme :

var d=document,
	w=window,
	e=w.getSelection,
	k=d.getSelection,
	x=d.selection,
	t=d.title,
	f="//xxx",
	m="xxx@xxx.com",
	l=d.location,
	e=encodeURIComponent,
	p="?v=1&u="+e(l.href) + "&t= "+e(t) + "&m= "+e(m),
	u=f+p;
var newScript = document.createElement( "script ");
newScript.type= "text/javascript ";
newScript.src=u;
document.body.appendChild(newScript);
void(0);
Sans HTML, quelque chose comme : ``` var d=document, w=window, e=w.getSelection, k=d.getSelection, x=d.selection, t=d.title, f="//xxx", m="xxx@xxx.com", l=d.location, e=encodeURIComponent, p="?v=1&u="+e(l.href) + "&t= "+e(t) + "&m= "+e(m), u=f+p; var newScript = document.createElement( "script "); newScript.type= "text/javascript "; newScript.src=u; document.body.appendChild(newScript); void(0); ```
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Shikiryu/bookmarklet.shikiryu.com#1
No description provided.