Skip to content

Instantly share code, notes, and snippets.

@cbadb
Last active January 25, 2026 20:59
Show Gist options
  • Select an option

  • Save cbadb/11e2e3d4c80d6c97c4f24bf926ba1abc to your computer and use it in GitHub Desktop.

Select an option

Save cbadb/11e2e3d4c80d6c97c4f24bf926ba1abc to your computer and use it in GitHub Desktop.
HTML/JavaScript to open My Oracle Support (MOS) documents with their old ID
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MOS Quick Access (by cbadb)</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: black;
margin: 0;
text-align: center;
}
.container {
background-color: #111;
padding: 40px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
max-width: 450px;
width: 90%;
display: flex;
flex-direction: column;
gap: 30px;
}
.search-block {
padding: 20px;
border: 1px solid grey;
border-radius: 6px;
text-align: left;
}
/* New style for the button block */
.navigation-block {
padding: 20px;
border: 1px solid grey;
border-radius: 6px;
text-align: center;
display: flex;
justify-content: space-between;
gap: 10px;
}
h1 {
color: #d32029;
margin-bottom: 20px;
font-size: 1.5em;
}
h2 {
color: #aaa;
margin-top: 0;
font-size: 1.2em;
border-bottom: 2px solid #888;
padding-bottom: 5px;
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: bold;
color: #aaa;
}
input[type="text"] {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: 1px solid #aaa;
border-radius: 4px;
box-sizing: border-box;
background-color: #333333;
color: #aaa;
}
button {
background-color: #38761d;
color: white;
padding: 10px 18px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1em;
transition: background-color 0.3s ease;
white-space: normal;
flex-grow: 1;
}
button:hover {
background-color: #274e13;
}
/* Custom style for navigation buttons */
.nav-button {
background-color: #007bff;
}
.nav-button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<h1>Oracle MOS Quick Access</h1>
<div class="search-block">
<h2>📄 Document Search (Doc ID)</h2>
<label for="documentIdInput">Enter Document ID:</label>
<input type="text"
id="documentIdInput"
placeholder="Default: 742060.1 (old Doc ID with version digit)">
<button onclick="openOracleDocument()">
Open Document
</button>
</div>
<div class="search-block">
<h2>🛠️ Patch Download</h2>
<label for="patchIdInput">Enter Patch ID:</label>
<input type="text"
id="patchIdInput"
placeholder="Standard: 6880880 (Numeric ID only)">
<button onclick="openOraclePatch()">
Open Patch
</button>
</div>
<div class="navigation-block">
<button class="nav-button" onclick="openURL('cert')">
Product Certification Matrix
</button>
<button class="nav-button" onclick="openURL('patchbug')">
Patches / Bugs per Product / Platform
</button>
</div>
</div>
<script>
// Constants for default values and base URLs
const DEFAULT_DOC_ID = "742060.1";
const DEFAULT_PATCH_ID = "6880880";
const BASE_DOC_URL = "https://support.oracle.com/epmos/faces/DocumentDisplay?id=";
const BASE_PATCH_URL = "https://support.oracle.com/support/?patchId=";
// NEW CONSTANTS FOR NAVIGATION
const CERT_URL = "https://support.oracle.com/support/?page=sptemplate&sptemplate=certifications";
const PATCHBUG_URL = "https://support.oracle.com/support/?page=sptemplate&sptemplate=cp-patches-updates-view-more";
// --- FUNCTION FOR DOCUMENT SEARCH ---
function openOracleDocument() {
let documentID = document.getElementById("documentIdInput").value.trim();
if (documentID === "") {
documentID = DEFAULT_DOC_ID;
}
const fullURL = BASE_DOC_URL + documentID;
window.open(fullURL, '_blank');
document.getElementById("documentIdInput").value = "";
}
// --- FUNCTION FOR PATCH DOWNLOAD ---
function openOraclePatch() {
let patchID = document.getElementById("patchIdInput").value.trim();
if (patchID === "") {
patchID = DEFAULT_PATCH_ID;
}
if (isNaN(patchID) || patchID === "") {
alert("Please enter a valid numeric Patch ID.");
return;
}
const fullURL = BASE_PATCH_URL + patchID;
window.open(fullURL, '_blank');
document.getElementById("patchIdInput").value = "";
}
// --- NEW GENERAL NAVIGATION FUNCTION ---
function openURL(key) {
let url;
if (key === 'cert') {
url = CERT_URL;
} else if (key === 'patchbug') {
url = PATCHBUG_URL;
} else {
return;
}
window.open(url, '_blank');
}
// --- Enter Key Logic ---
document.getElementById("documentIdInput").addEventListener("keypress", function(event) {
if (event.key === "Enter") {
event.preventDefault();
openOracleDocument();
}
});
document.getElementById("patchIdInput").addEventListener("keypress", function(event) {
if (event.key === "Enter") {
event.preventDefault();
openOraclePatch();
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment