Advertisement
jcunews

opera-browserjs-check.html

Mar 30th, 2021 (edited)
1,413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.25 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4.   <meta charset="utf-8" />
  5.   <title>Opera browser.js Check Bookmarklet</title>
  6.   <style>
  7. code {
  8.   padding: 0 .2em;
  9.   background: #eee;
  10.   font-size: 13pt
  11. }
  12. #source {
  13.   display: block;
  14.   box-sizing: border-box;
  15.   padding: 0 .3em .2em .3em;
  16.   width: 100%;
  17.   height: 100%;
  18.   overflow: auto;
  19.   resize: none;
  20.   background: #eee;
  21.   white-space: pre;
  22.   font-family: monospace;
  23.   font-size: 12pt
  24. }
  25.   </style>
  26.   <script>
  27. function operaBrowserJsCheck() {
  28.   /* Version 1.0.1
  29.      https://pastebin.com/u/jcunews
  30.      https://www.reddit.com/user/jcunews1
  31.      https://greasyfork.org/en/users/85671-jcunews */
  32.   var url = "https://www.opera.com/";
  33.   if (location.hostname !== "www.opera.com") {
  34.     if (confirm(` browser.js status can only checked from the official Opera website.\n
  35.  Do you want to go to ${url} now?\n
  36.  Once the page is loaded, run this bookmarklet again.`)) location.href = url;
  37.     return
  38.   }
  39.   history.replaceState(null, "", url + "docs/browserjs/");
  40.   document.write(`<!doctype html><html>
  41. <head>
  42.   <meta charset="utf-8" /><title>Opera browser.js Check</title>
  43. </head>
  44. <body style="font-size:16pt">
  45.   <div id="browserjs_status_message" style="font-weight:bold">
  46.     Current browser.js status: disabled.
  47.   </div>
  48.   <div id="browserjs_active" style="display:none">
  49.     <b>Current browser.js status:</b>
  50.     <span style="display:block;margin-top:.5em"></span>
  51.   </div>
  52.   <scr` + `ipt>
  53. setTimeout(() => history.replaceState(null, "", "${url}"), 200)
  54.   </sc` + `ript>
  55. </body></html>`);
  56.   document.close()
  57. }
  58.   </script>
  59. </head>
  60. <body style="display:flex;margin:.5em 4%;justify-content:center;font-size:14pt">
  61.   <div style="min-width:22em;max-width:22em;height:calc(100vh - 2em)">
  62.     Opera website used to have a page for checking the browser.js status at: <a href="https://www.opera.com/docs/browserjs/"><code>https://www.opera.com/docs/browserjs/</code></a>, but that page is no longer exist.
  63.     <p></p>
  64.     Although an <a href="https://web.archive.org/web/20180412124326/https://www.opera.com/docs/browserjs/">archived version of the page</a> is available at Web Archive, the status of the <code>browser.js</code> can not be checked because it is not served from <code>opera.com</code> domain.
  65.     <p></p>
  66.     This bookmarklet code provides a way to check the status of the <code>browser.js</code>, by replacing the content of a web page in Opera website with a content that check the <code>browser.js</code> status. It is applicable for Chromium based Opera (Opera v15+).
  67.     <p></p>
  68.     To use the bookmarklet, drag upward or downward this <a id="lnk">Opera browser.js Check</a> link and drop it onto the bookmark toolbar, or right-click on it and add the link into bookmarks.
  69.     <p></p>
  70.     Click on the bookmarklet or bookmark. If the current tab is not on Opera website, it will prompt to go to that site. Once the Opera website page is loaded, click on the bookmarklet or bookmark again.
  71.   </div>
  72.   <div style="width:8%"></div>
  73.   <div style="display:flex;flex-direction:column;width:100%;height:calc(100vh - 2em)">
  74.     Bookmarklet source code:
  75.     <textarea id="source" readonly></textarea>
  76.   </div>
  77.   <script>
  78. lnk.href = source.value = `javascript:(${operaBrowserJsCheck})()`;
  79.   </script>
  80. </body>
  81. </html>
  82.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement