Skip to content

Instantly share code, notes, and snippets.

@milothiesen
Created November 17, 2018 00:59
Show Gist options
  • Save milothiesen/ca2110d5c0b239fc33e6492447d5c929 to your computer and use it in GitHub Desktop.
Save milothiesen/ca2110d5c0b239fc33e6492447d5c929 to your computer and use it in GitHub Desktop.
NetX Wrappify - The Met
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