Skip to content

Commit

Permalink
v1.46.1: cherry-pick 01e4245 from devel branch (-mse221304, prepare f…
Browse files Browse the repository at this point in the history
…or meta host name change)
  • Loading branch information
vyznev committed Mar 10, 2017
1 parent dba966d commit dd4e305
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 34 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ A major new feature in this release is that SOUP v1.46 will be the first stable
* Rewrote [mse66646](http://meta.stackexchange.com/q/66646) fix for compatibility with new SE code. (The [related IME issue](http://meta.stackexchange.com/q/216834) seems to have been fixed, but this can still be triggered e.g. by the Firefox spell checker menu.)
* Disabled the [mse207526](http://meta.stackexchange.com/q/207526) fix when the [new topbar](http://meta.stackoverflow.com/q/343103) is enabled, to avoid issues with dialog positioning. (Thanks, mjpieters!)

**Changes in 1.46.1:**

* Removed **[mse221304: Make all i.stack.imgur.com links protocol-relative](http://meta.stackexchange.com/q/221304)** (no longer needed)
* Prepare for the renaming of per-site meta hostnames from `meta.*.stackexchange.com` to `*.meta.stackexchange.com`, make sure fixes continue to run on the correct sites.
* Don't auto-rewrite links to the old meta hostnames to use HTTPS, since they have broken certs.


1.44 (5 Feb 2016)
====
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- thumbnail: http://i.stack.imgur.com/8EphO.png -->
<!-- version: 1.46.0 -->
<!-- version: 1.46.1 -->

![](http://i.stack.imgur.com/IzzhJ.png "SOUP logo")

Expand Down Expand Up @@ -34,7 +34,7 @@ Note that updates to the extension packages available at Firefox Add-ons and Chr
Included fixes
--------------

SOUP v1.46.0
SOUP v1.46.1
&#x20;
includes fixes or workarounds for the following issues.

Expand Down Expand Up @@ -160,7 +160,6 @@ These fixes apply to the post review interface. I've listed them separately her
These fixes are only applied when using Stack Exchange over HTTPS. Note that [HTTPS support for Stack Exchange is still experimental.](http://meta.stackexchange.com/questions/116782/better-https-support-for-stack-exchange-sites)

* **[mse223725: All internal links on Stack Exchange sites should be protocol-relative](http://meta.stackexchange.com/q/223725)**
* **[mse221304: Make all i.stack.imgur.com links protocol-relative](http://meta.stackexchange.com/q/221304)**

### MathJax-related fixes:

Expand Down
2 changes: 1 addition & 1 deletion SOUP.meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @namespace https://github.com/vyznev/
// @description Miscellaneous client-side fixes for bugs on Stack Exchange sites
// @author Ilmari Karonen
// @version 1.46.0
// @version 1.46.1
// @copyright 2014-2016, Ilmari Karonen (http://stackapps.com/users/10283/ilmari-karonen)
// @license ISC; http://opensource.org/licenses/ISC
// @match *://*.stackexchange.com/*
Expand Down
36 changes: 8 additions & 28 deletions SOUP.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @namespace https://github.com/vyznev/
// @description Miscellaneous client-side fixes for bugs on Stack Exchange sites
// @author Ilmari Karonen
// @version 1.46.0
// @version 1.46.1
// @copyright 2014-2016, Ilmari Karonen (http://stackapps.com/users/10283/ilmari-karonen)
// @license ISC; http://opensource.org/licenses/ISC
// @match *://*.stackexchange.com/*
Expand Down Expand Up @@ -279,7 +279,7 @@ fixes.codegolf959 = {
fixes.math12902 = {
title: "Visited questions are practically indistinguishable in search results",
url: "http://meta.math.stackexchange.com/q/12902",
sites: /^math\./,
sites: /^math\.stackexchange\./,
// "body" added to override conflicting SE styles
css: "body a, body .question-hyperlink { color: #145d8a }" +
"body a:visited, body .question-hyperlink:visited { color: #003b52 }" +
Expand All @@ -294,21 +294,21 @@ fixes.math12902 = {
fixes.math12902_meta = {
title: "Visited questions are practically indistinguishable in search results (meta)",
url: "http://meta.math.stackexchange.com/q/12902",
sites: /^meta\.math\./,
sites: /^meta\.math\.|^math\.meta\./,
// "body" added to override conflicting SE styles
css: "body a { color: #a29131 } body a:visited { color: #736722 }"
};
fixes.math16559 = {
title: "Typo in site CSS disables visited link color in community bulletin",
url: "http://meta.math.stackexchange.com/q/16559",
sites: /^math\./,
sites: /^math\.stackexchange\./,
// this rule is already in the site CSS, but without the colon in "a:visited"
css: ".module.community-bulletin a:visited { color: #32455d !important }"
};
fixes.math16559_meta = {
title: "Typo in site CSS disables visited link color in community bulletin (meta)",
url: "http://meta.math.stackexchange.com/q/16559",
sites: /^meta\.math\./,
sites: /^meta\.math\.|^math\.meta\./,
css: ".module.community-bulletin a:visited { color: #444 !important }"
};
fixes.electronics3162 = {
Expand Down Expand Up @@ -1432,7 +1432,7 @@ fixes.mse223725 = {
script: function () {
if ( 'https:' != location.protocol ) return;
var selector = 'a[href^="http://"]';
var filter = /^([^.]+\.)*((stack(exchange|overflow|apps)|superuser|serverfault|askubuntu)\.com|mathoverflow\.net)$/;
var filter = /^([^.]+\.)?(((meta\.)?stackexchange|stackoverflow|stackapps|superuser|serverfault|askubuntu)\.com|mathoverflow\.net)$/;
var exclude = /^(blog|elections)\./; // these sites still don't work properly over HTTPS :-(
var fixLink = function () {
if ( ! filter.test( this.hostname ) || exclude.test( this.hostname ) ) return;
Expand All @@ -1446,27 +1446,7 @@ fixes.mse223725 = {
$(document).on( 'mouseover click', selector, fixLink );
}
};
if ( 'https:' === location.protocol ) fixes.mse221304 = {
title: "Make all i.stack.imgur.com links protocol-relative",
url: "http://meta.stackexchange.com/q/221304",
script: function () {
// fallback: try to reload failed insecure images over HTTPS
var urlRegex = /^http:\/\/(([a-z0-9\-]+\.)*((imgur|gravatar|facebook|googleapis)\.com|wikimedia\.org|sstatic\.net|(stack(exchange|overflow|apps)|superuser|serverfault|askubuntu)\.com|mathoverflow\.net))\//i;
var fixImages = function (target) {
$(target).find('img[src^="http://"]').each( function () {
if ( ! urlRegex.test( this.src ) ) return;
if ( ! this.complete || this.naturalWidth > 0 ) return;
var newUrl = this.src.replace( urlRegex, 'https://$1/' );
SOUP.log( 'soup mse221304 fixing img ' + this.src + ' -> ' + newUrl );
this.src = newUrl;
} );
};
SOUP.addContentFilter( fixImages, 'HTTPS image fix' );
$(document).on( 'mouseenter', '#user-menu', function () {
SOUP.try( 'HTTPS image fix', fixImages, [this] );
} );
}
};



//
Expand Down Expand Up @@ -1611,7 +1591,7 @@ var soupInit = function () {
// basic environment detection, part 1
// (for MathJax detection, just check window.MathJax, and note that it may be loaded late due to mse215450)
SOUP.isChat = /^chat\./.test( location.hostname );
SOUP.isMeta = /^meta\./.test( location.hostname );
SOUP.isMeta = /(^|\.)meta\./.test( location.hostname );

// run code after jQuery and/or SE framework have loaded
SOUP.readyQueue = {};
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"short_name": "SOUP",
"description": "Miscellaneous client-side fixes for bugs on Stack Exchange sites",
"author": "Ilmari Karonen",
"version": "1.46.0",
"version_name": "1.46.0",
"version": "1.46.1",
"version_name": "1.46.1",
"homepage_url": "http://stackapps.com/questions/4486/stack-overflow-unofficial-patch",
"icons": {
"16": "icon/SOUP_icon_16.png",
Expand Down

0 comments on commit dd4e305

Please sign in to comment.