Created
November 17, 2018 00:59
-
-
Save milothiesen/ca2110d5c0b239fc33e6492447d5c929 to your computer and use it in GitHub Desktop.
NetX Wrappify - The Met
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
manifest.json | |
{ | |
"manifest_version": 2, | |
"name": "NetX - wrappify", | |
"description": "This extension will remove truncation from all fields in curator view", | |
"version": "0.0.0.1", | |
"author": "Milo Thiesen - Lead Technical Analyst - Metropolitan Museum of Art", | |
"background": { | |
"scripts": ["jquery-3.3.1.min.js","background.js"] | |
}, | |
"permissions": ["activeTab"], | |
"browser_action": { | |
"default_icon": "vision.png" | |
} | |
} | |
background.js | |
function handleClick(tab) { | |
chrome.tabs.executeScript(null, { file: "jquery-3.3.1.min.js" }, function() { | |
chrome.tabs.executeScript(null, { file: "expand_text.js" }); | |
}); | |
} | |
chrome.browserAction.onClicked.addListener(handleClick); | |
expand_text.js | |
$('.asset-attributes-wrapper .attribute .text').each(function( index ) { | |
try { $.title = ( this.title )} catch {}; $( $(this).text($.title).css({'word-break':'break-word'}) ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment