Open boards directly in Pinterest when clicked

I’d like the boards open on Pinterest when you click on them

2 Likes

Hi there, @urban_end_of_tenancy :wave:

Glad to say that you can do this using this code in the Custom JS field on the Style tab of your widget’s settings:

document.addEventListener("click", ({ target }) => {
  const item = target.closest(".eapps-pinterest-feed-data-item-boards-item");
  const anchor = item?.querySelector("a");
  if (!anchor) {
    return;
  }
  
  anchor.target = "_self";
  anchor.click();
  
  const back = document.querySelector(".eapps-pinterest-feed-data-item-navigation-item");
  back?.click();
});

This way, the boards will be opened in the same tab. If you want to open them in a new tab, please remove this line from the code anchor.target = "_self";


Try it out and let me know how it worked :wink:

1 Like