1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

QiitaのTwitter共有がバグってるのでさっそく分析してみる

Posted at

バグった共有ボタン

このツイートボタンを押したら、「https://twitter.com/share」のリンクを共有してしまいます。

原因?

hrefにURLが指定されていない
hrefに?url=パラメータがありません。

修正

Tampermonkeyで。

// ==UserScript==
// @name         Twitter fix
// @version      1.0
// @description  Fix twitter link
// @author       apple502j
// @match        https://qiita.com/advent-calendar/*
// ==/UserScript==

window.addEventListener("load", function(){
    for (const item of document.querySelectorAll("a.twitter-share-button")) item.href += "?url=" + item.dataset.url;
});
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?