Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.

Commit

Permalink
display tooltip with link address when hovering over link
Browse files Browse the repository at this point in the history
This feature was accidentally deleted during the Gmail transition.
  • Loading branch information
Jose Marino committed Mar 28, 2019
1 parent 90204d5 commit 10fe23f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/main/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const fs = require('fs');
const path = require('path');
const {
app, BrowserWindow, Menu, shell, ipcMain, nativeImage, Notification, dialog,
Expand Down Expand Up @@ -150,6 +151,10 @@ app.on('ready', () => {

const { webContents } = mainWindow;

webContents.on('dom-ready', () => {
webContents.insertCSS(fs.readFileSync(path.join(__dirname, '../renderer/browser.css'), 'utf8'));
});

webContents.on('will-navigate', (e, url) => {
if (config.get('sendAnalytics')) analytics.track('will-navigate');
if (!allowedUrl(url)) {
Expand Down
22 changes: 22 additions & 0 deletions app/renderer/browser.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Tooltip to display link contents */
/* <div class="AO"> contains message view area (right side of window) */
div.AO a[href]::after {
content: attr(href);
position: absolute;
transform: translateY(100%);
left: 0;
background: rgba(0,0,0,0.7);
text-align: center;
color: #fff;
font-size: small;
border-radius: 5px;
pointer-events: none;
padding: 4px 8px;
z-index:99;
opacity:0;
transition: opacity 0.5s;
}

div.AO a[href]:hover::after {
opacity:1
}

0 comments on commit 10fe23f

Please sign in to comment.