MasterOpel

Embedder Bookmarklets for CompSci class

Sep 2nd, 2024 (edited)
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.39 KB | Source Code | 0 0
  1. Bookmarklets -
  2.  
  3.  
  4. Page Embedder:
  5. javascript:var url = prompt("What website do you want to embed?");if(url != null){var iframe = document.createElement("iframe");iframe.src = "https://" + url.replaceAll("https://", "");iframe.title = url;iframe.frameBorder = 0;iframe.scrolling = "yes";iframe.style = "position: absolute; overflow: hidden; width: 100%; height: 100%; left: 0; right: 0; top: 0; bottom: 0;";iframe.width = "100%";iframe.height = "100%";document.body = document.createElement("body");document.body.appendChild(iframe);}
  6.  
  7. Google (don't retain original content):
  8. javascript:var GoogleEmbedScript = document.createElement("script");var GoogleEmbedDiv = document.createElement("div");GoogleEmbedScript.src = "https://cse.google.com/cse.js?cx=7553909a4c94c4d2d";GoogleEmbedDiv.className = "gcse-search";document.body = document.createElement("body");document.body.appendChild(GoogleEmbedScript);document.body.appendChild(GoogleEmbedDiv);
  9.  
  10. Google (retain original content):
  11. javascript:var GoogleEmbedScript = document.createElement("script");var GoogleEmbedDiv = document.createElement("div");GoogleEmbedScript.src = "https://cse.google.com/cse.js?cx=7553909a4c94c4d2d";GoogleEmbedDiv.className = "gcse-search";document.body.appendChild(GoogleEmbedScript);document.body.appendChild(GoogleEmbedDiv);
  12.  
  13. Remove Google Search Embed:
  14. javascript:document.body.removeChild(document.querySelector("#___gcse_0"));
Advertisement
Add Comment
Please, Sign In to add comment