Modifying Google Drive Interface for Team Collaboration

Hey everyone, I’m in charge of our company’s G Suite setup. We need to make sure our team members leave a comment before they delete files from our shared Team Drive. It’s a bit tricky though!

I’ve been looking into it and it seems like we need to create a Chrome extension to change how Team Drive looks and works. The problem is, the new Google Drive uses HTML5 and I can’t find the right element for the delete button. This means I can’t get my custom script to work when someone clicks delete.

Right now, I’ve got this script that runs whenever someone clicks on any div:

function checkClick(event) {
  console.log(event.target.getAttribute('aria-label'));
  if (event.target.classList.contains('team-drive-delete-btn')) {
    console.log('Delete button clicked!');
  }
}

document.addEventListener('click', checkClick);

Does anyone have ideas on how to make this work? Or maybe there’s a better way to add this comment requirement? Any help would be awesome!

Have you considered using Google Drive’s built-in activity tracking features instead? It might be simpler than creating a custom extension. You can set up alerts for file deletions in the Drive audit log, which automatically records who deleted what and when. This way, you don’t need to modify the interface, but you still get the oversight you’re looking for. If you really need comments before deletion, you could create a Google Form for file removal requests. Team members would submit the form with their reason before deleting, giving you a paper trail without the technical headaches of altering Drive’s interface.

I had a similar issue with our team’s Drive setup and found an alternative approach that might be helpful. Instead of trying to modify the interface directly with a Chrome extension, we used a Google Apps Script solution. Our script runs on a time-based trigger, checking every 15 minutes for files deleted from the Team Drive. It determines if a file was removed without a preceding comment and notifies both the administrator and the user involved. We also added a custom menu in Drive to remind users to leave comments before deleting files. This method, although it doesn’t prevent deletions, promotes accountability and is much easier to maintain.

hey, have you looked into using Google Workspace add-ons? they’re easier to make than chrome extensions and can integrate right into drive. you could create a custom sidebar that pops up when someone selects a file, prompting them to leave a comment before deleting. it might not catch every scenario, but it could work for most cases without messing with the actual drive interface.