Skip to content

Instantly share code, notes, and snippets.

@dangerouse
Created April 16, 2022 17:01
Show Gist options
  • Save dangerouse/f5e9f41fcdeb3d8e26f97803972aa6f2 to your computer and use it in GitHub Desktop.
Save dangerouse/f5e9f41fcdeb3d8e26f97803972aa6f2 to your computer and use it in GitHub Desktop.
Inject the Contact Picker via console
(function(key, opts, s) {
s = document.createElement('script');
s.type = 'text/javascript';
s.async = 1;
// assign the src attribute
s.src = "https://api.cloudsponge.com/widget/"+key+".js";
// set the script to invoke a callback after it loads
s.onload = function() {
window.cloudsponge && cloudsponge.init(opts);
}
// add the script to the page
document.body.appendChild(s);
})("YOUR CLOUDSPONGE KEY", {
// cloudsponge options go here
});
@dangerouse
Copy link
Author

Steps:

  1. Right-click on the "To" field and select 'inspect'. The inspector will open and highlight the HTML with the field.
  2. Right-click on the highlighted field in the inspector and click 'Edit as HTML'.
  3. Add a link to launch the Contact picker: <a href="#" class="cloudsponge-launch">Pick Contacts</a> and update the To field with the attribute class="cloudsponge-contacts".
  4. Change to the 'console' tab in the inpsector.
  5. Paste this code, edit YOUR CLOUDSPONGE KEY and add any options you want to include. Press enter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment