Skip to content

Commit

Permalink
oujs - Meta View 4.3.0
Browse files Browse the repository at this point in the history
* Fix for Fx 57 not recognizing relative urls in xhr... seriously?
* Give some scroll bars if GM4 is detected. Ace is going to be an issue since Page Scripts and Content Scripts don't see each other.
  • Loading branch information
Martii committed Nov 30, 2017
1 parent 627cb88 commit 28b14e5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/oujs/Meta View/oujs - Meta View.user.js
Expand Up @@ -5,7 +5,7 @@
// @copyright 2014+, Marti Martz (https://openuserjs.org/users/Marti)
// @license CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
// @license GPL-3.0+; http://www.gnu.org/licenses/gpl-3.0.txt
// @version 4.2.3
// @version 4.3.0
// @icon https://www.gravatar.com/avatar/7ff58eb098c23feafa72e0b4cd13f396?r=G&s=48&default=identicon

// @homepageURL https://github.com/Martii/UserScripts/tree/master/src/oujs/Meta%20View
Expand All @@ -32,6 +32,8 @@
*
*/

var FQDN = window.location.protocol + '//' + window.location.host;

var matches = location.pathname.match(/^\/scripts\/(.*?)\/(.*?)(?:$|\/)/);
if (matches) {
var
Expand Down Expand Up @@ -223,7 +225,7 @@

hookNode.appendChild(NodeDiv);

var url = '/src/scripts/' + userName + '/' + scriptName + '.user.js';
var url = FQDN + '/src/scripts/' + userName + '/' + scriptName + '.user.js';

var req = new XMLHttpRequest();
req.open('GET', url);
Expand Down Expand Up @@ -280,7 +282,7 @@

NodeText.textContent = ": Fetching the meta.json";

url = '/meta/' + userName + '/' + scriptName + '.meta.json';
url = FQDN + '/meta/' + userName + '/' + scriptName + '.meta.json';

var req = new XMLHttpRequest();
req.open('GET', url);
Expand Down Expand Up @@ -381,11 +383,13 @@

NodeStyle.textContent =
[
'#mdb { min-height: 115px; }',
'#json { min-height: 115px; height: -moz-calc(' + min_height + 'vh - ' + offset + 'px); height: -o-calc(' + min_height + 'vh - ' + offset + 'px); height: -webkit-calc(' + min_height + 'vh - ' + offset + 'px); height: calc(' + min_height + 'vh - ' + offset + 'px); }',
'#mdb { min-height: 115px; ' + (typeof GM === 'object' ? 'overflow: scroll !important;' : '') + '}',
'#json { min-height: 115px; height: -moz-calc(' + min_height + 'vh - ' + offset + 'px); height: -o-calc(' + min_height + 'vh - ' + offset + 'px); height: -webkit-calc(' + min_height + 'vh - ' + offset + 'px); height: calc(' + min_height + 'vh - ' + offset + 'px); ' + (typeof GM === 'object' ? 'overflow: scroll !important;' : '') + '}',
'.path-divider { color: #666; margin: 0 0.25em; }',
'#mdb .ace_gutter { background: #ebebeb url(' + textSVGMetaJS + ') repeat-y scroll left top !important; }',
'#json .ace_gutter { background: #ebebeb url(' + textSVGMetaJSON + ') repeat-y scroll left top !important; }'
'#json .ace_gutter { background: #ebebeb url(' + textSVGMetaJSON + ') repeat-y scroll left top !important; }',


].join('\n')
;
document.head.appendChild(NodeStyle);
Expand Down

3 comments on commit 28b14e5

@Martii
Copy link
Owner Author

@Martii Martii commented on 28b14e5 Dec 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Martii
Copy link
Owner Author

@Martii Martii commented on 28b14e5 Jan 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New Refs:

RESULT:

  • Still hangs without protocol and FQDN with GM 4.2b1
  • Existing work-around doesn't seem to work either. :\ Nothing in browser console.

@Martii
Copy link
Owner Author

@Martii Martii commented on 28b14e5 Jan 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be addressed at greasemonkey/greasemonkey/commit/c341a10 with GM 4.2beta2. So far so good. :)

Please sign in to comment.