Blackboard Collaborate Hide Avatar Images

Hides Avatar Images on Blackboard Collaborate

  1. // ==UserScript==
  2. // @name Blackboard Collaborate Hide Avatar Images
  3. // @namespace http://userstyles.org
  4. // @description Hides Avatar Images on Blackboard Collaborate
  5. // @author 636597
  6. // @include *://*bbcollab.com/collab/ui/session/join/*
  7. // @run-at document-start
  8. // @version 0.7
  9. // ==/UserScript==
  10.  
  11. function hide_existing_avatars() {
  12. try{
  13. let avatars = document.querySelectorAll( "img.no-avatar" );
  14. for ( let i = 0; i < avatars.length; ++i ){
  15. avatars[ i ].src = "/collab/ui/session/21.0.7-localization.0/assets/images/avatars/no-avatar.svg";
  16. avatars[ i ]["ng-src"] = "/collab/ui/session/21.0.7-localization.0/assets/images/avatars/no-avatar.svg";
  17. }
  18. let small_avatars = document.querySelectorAll( "div.avatar-image" );
  19. for ( let i = 0; i < small_avatars.length; ++i ){
  20. small_avatars[ i ].childNodes[ 1 ].src = "/collab/ui/session/21.0.7-localization.0/assets/images/avatars/no-avatar.svg"
  21. }
  22. }
  23. catch( e ) {}
  24. }
  25.  
  26. function add_hide_avatar_css() {
  27. var style_sheets = window.document.styleSheets;
  28. var override_avatar_images_rule = `img.no-avatar {
  29. background: url( "/collab/ui/session/21.0.7-localization.0/assets/images/avatars/no-avatar.svg" ) no-repeat;
  30. content: url("/collab/ui/session/21.0.7-localization.0/assets/images/avatars/no-avatar.svg");
  31. !important;
  32. }`;
  33. for ( let i = 0; i < style_sheets.length; ++i ) {
  34. try {
  35. style_sheets[ i ].insertRule( override_avatar_images_rule , style_sheets[ i ].cssRules.length );
  36. console.log( i );
  37. return;
  38. }
  39. catch( e ) {};
  40. }
  41. }
  42.  
  43. var URL_STATE_IN_2020_INTERVAL = false;
  44. var HIDE_AVATAR_INTERVAL = false;
  45. var CURRENT_URL = false;
  46. function observe_url_state() {
  47. if ( CURRENT_URL !== window.location.href ) {
  48. console.log( "URL State Changed" );
  49. CURRENT_URL = window.location.href;
  50. hide_existing_avatars();
  51. add_hide_avatar_css();
  52. }
  53. }
  54.  
  55. function init() {
  56. console.log( "Loading Blackboard Collaborate Avatar Image Hider" );
  57. hide_existing_avatars();
  58. add_hide_avatar_css();
  59. URL_STATE_IN_2020_INTERVAL = setInterval( observe_url_state , 500 );
  60. HIDE_AVATAR_INTERVAL = setInterval( hide_existing_avatars , 1000 );
  61. }
  62.  
  63. ( function() {
  64. window.addEventListener ( "load" , init );
  65. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址