masalibの日記

システム開発、運用と猫の写真ブログです

Google検索で正しくレンダリングされていることを確認する

www.suzukikenichi.com

上記のサイトにも記載されていますが
チェックはサーチコンソールでもできます
ただ1日10回と限られているので大量にチェックしたい場合は
google先生が用意しているプログラムを実行する事で確認ができるそうです

Googlebotについて

Chrome 41(M41)に基づくWebレンダリングサービス(WRS)をしている
Googlebotと同じにするにはサポートしていない機能(indexdb、WebSQL、セッション、CookieWebGl..etcなど)も無効にする必要があります

前提

node.jsは8以上がはいっている前提です
gitがインストールされている
 →SourceTreeをいれれば動くはず・・・

google先生のプログラムもrobots.txtに対応していないので注意する必要がある
再起の制限がないみたいなので対象は記事にする
サイトトップでやるとなかなか返ってこない

プログラムをいれる

git clone https://github.com/GoogleChromeLabs/puppeteer-examples
cd puppeteer-examples
npm install

チェックするURLを変更して実行する

デフォルトの場合はgooglechromeのページなので
自分がチェックしたURLに変える
URLは環境変数にいれればOK

linux系の場合

URL="https://masalib.hatenablog.com/entry/2018/07/12/100000" node google_search_features.js

チェックした結果(linux系の場合)

puppeteer-examples git:(master) ✗ URL="https://masalib.hatenablog.com/entry/2018/07/12/100000" node google_search_features.js
Trace started.
Navigating to https://masalib.hatenablog.com/entry/2018/07/12/100000
Waiting for page to be idle...
Trace complete.

CAREFUL: using 130 HTML/JS, 126 CSS features. Some features are not supported by the Google Search crawler.
The bot runs Chrome 41, which may not render your page correctly when it's being indexed.

More info at https://developers.google.com/search/docs/guides/rendering.

Features used which are not supported by Google Search:

- AddEventListenerPassiveTrue: https://caniuse.com/#feat=passive-event-listener
- AddEventListenerThirdArgumentIsObject: https://caniuse.com/#feat=once-event-listener
- Fetch: https://caniuse.com/#feat=fetch
- HTMLSlotElement: https://caniuse.com/#feat=shadowdomv1
- IntersectionObserver_Constructor: https://caniuse.com/#feat=intersectionobserver
- LinkRelPreload: https://caniuse.com/#feat=link-rel-preload

All features used on the page:

- AddEventListenerPassiveTrue
- AddEventListenerThirdArgumentIsObject
- AuxclickAddListenerCount
- BarPropLocationbar
- BarPropMenubar
- BarPropScrollbars
- BarPropStatusbar
- BarPropToolbar
- BaseElement
- BlinkMacSystemFont
- CSPWithUnsafeDynamic
- CSPWithUnsafeEval
- CSSAtRuleCharset
- CSSAtRuleFontFace
- CSSAtRuleKeyframes
- CSSAtRuleMedia
- CSSAtRuleWebkitKeyframes
- CSSFlexibleBox
- CSSGradient
- CSSSelectorPseudoFocus
- CSSSelectorWebkitInnerSpinButton
- CSSSelectorWebkitSearchCancelButton
- CSSSelectorWebkitUnknownPseudo
- CSSValueAppearanceNone
- CanvasToDataURL
- CleanScriptElementWithNonce
- ContentSecurityPolicy
- ContentSecurityPolicyReportOnly
- ContentSecurityPolicyWithBaseElement
- CookieGet
- CookieSet
- CrossOriginApplicationScript
- CrossOriginHTMLIFrameElementContentDocument
- CrossOriginMainFrameNulledNameAccessed
- CrossOriginPropertyAccess
- CrossOriginTextPlain
- CrossOriginTextScript
- CryptoGetRandomValues
- DeprecatedWebKitGradient
- DocumentAll
- DocumentBeforeUnloadRegistered
- DocumentDomainSetWithDefaultPort
- DocumentPageHideRegistered
- DocumentSetDomain
- DocumentUnloadRegistered
- ElementPrefixedMatchesSelector
- FeaturePolicyAllowAttribute
- Fetch
- FontShapingNotDefGlyphObserved
- FormElement
- FormsSubmitted
- HTMLCanvasElement
- HTMLContentElement
- HTMLElementDeprecatedWidth
- HTMLElementInnerText
- HTMLSlotElement
- HasBeforeOrAfterPseudoElement
- HasIDClassTagAttribute
- IntersectionObserver_Constructor
- LangAttribute
- LangAttributeDoesNotMatchToUILocale
- LangAttributeOnHTML
- LinkRelDnsPrefetch
- LinkRelPreload
- LocationOrigin
- MetaRefresh
- MixedContentBlockable
- MixedContentPresent
- NamedAccessOnWindow_ChildBrowsingContext
- NavigatorDeviceMemory
- NavigatorProductSub
- NavigatorVendor
- NavigatorVendorSub
- NetInfo
- NetInfoDownlink
- NetInfoEffectiveType
- NetInfoOnChange
- NetInfoRtt
- NetInfoSaveData
- OBSOLETE_DocumentOpen
- PendingStylesheetAddedAfterBodyStarted
- PerformanceTimeline
- PrefixedDevicePixelRatioMediaFeature
- PrefixedMinDevicePixelRatioMediaFeature
- PrefixedStorageQuota
- PresentationDefaultRequest
- QuirksModeDocument
- RemoveEventListenerThirdArgumentIsObject
- ReportUriSingleEndpoint
- SVGSVGElement
- SVGSVGElementInDocument
- SVGSVGElementInXMLDocument
- SameOriginApplicationScript
- SameOriginTextScript
- ScrollToFragmentFailWithASCII
- ScrollToFragmentFailWithUTF8
- ScrollToFragmentRequested
- ScrollToFragmentSucceedWithRaw
- SecureContextCheckFailed
- SecureContextCheckForSandboxedOriginFailed
- SecureContextCheckPassed
- SetReferrerPolicy
- SingleOriginInTimingAllowOrigin
- StarInTimingAllowOrigin
- SubFrameBeforeUnloadRegistered
- TimeElement
- UnprefixedRequestAnimationFrame
- V8CustomEvent_InitCustomEvent_Method
- V8DeoptimizerDisableSpeculation
- V8Document_Scripts_AttributeGetter
- V8Element_GetBoundingClientRect_Method
- V8Element_GetClientRects_Method
- V8ErrorStackTraceLimit
- V8HTMLComment
- V8LegacyDateParser
- V8MessageChannel_Constructor
- V8MessagePort_PostMessage_Method
- V8Performance_Timing_AttributeGetter
- V8Screen_AvailTop_AttributeGetter
- V8SloppyMode
- V8StrictMode
- WindowPostMessage
- WindowScreenLeft
- WindowScreenTop
- XMLDocument
- XMLHttpRequestAsynchronous
- XMLHttpRequestCrossOriginWithCredentials
- XSSAuditorDisabled
- XSSAuditorEnabledBlock
- XSSAuditorEnabledFilter
- CSS `alias-webkit-border-bottom-left-radius`
- CSS `alias-webkit-border-bottom-right-radius`
- CSS `alias-webkit-border-radius`
- CSS `alias-webkit-border-top-left-radius`
- CSS `alias-webkit-border-top-right-radius`
- CSS `alias-webkit-box-shadow`
- CSS `alias-webkit-box-sizing`
- CSS `alias-webkit-text-size-adjust`
- CSS `alias-webkit-transform`
- CSS `alias-webkit-transition`
- CSS `alias-webkit-transition-property`
- CSS `align-items`
- CSS `animation`
- CSS `animation-duration`
- CSS `animation-name`
- CSS `background`
- CSS `background-clip`
- CSS `background-color`
- CSS `background-image`
- CSS `background-position`
- CSS `background-repeat`
- CSS `background-size`
- CSS `border`
- CSS `border-bottom`
- CSS `border-bottom-left-radius`
- CSS `border-bottom-right-radius`
- CSS `border-collapse`
- CSS `border-color`
- CSS `border-image`
- CSS `border-left`
- CSS `border-left-color`
- CSS `border-radius`
- CSS `border-right`
- CSS `border-right-color`
- CSS `border-spacing`
- CSS `border-style`
- CSS `border-top`
- CSS `border-top-color`
- CSS `border-top-left-radius`
- CSS `border-top-right-radius`
- CSS `border-width`
- CSS `bottom`
- CSS `box-shadow`
- CSS `box-sizing`
- CSS `clear`
- CSS `clip`
- CSS `color`
- CSS `content`
- CSS `cursor`
- CSS `direction`
- CSS `display`
- CSS `fill`
- CSS `fill-opacity`
- CSS `flex-direction`
- CSS `float`
- CSS `font`
- CSS `font-family`
- CSS `font-size`
- CSS `font-style`
- CSS `font-variant`
- CSS `font-weight`
- CSS `height`
- CSS `image-rendering`
- CSS `justify-content`
- CSS `left`
- CSS `letter-spacing`
- CSS `line-height`
- CSS `list-style`
- CSS `list-style-type`
- CSS `margin`
- CSS `margin-bottom`
- CSS `margin-left`
- CSS `margin-right`
- CSS `margin-top`
- CSS `max-height`
- CSS `max-width`
- CSS `min-height`
- CSS `min-width`
- CSS `opacity`
- CSS `outline`
- CSS `outline-color`
- CSS `outline-style`
- CSS `overflow`
- CSS `overflow-x`
- CSS `padding`
- CSS `padding-bottom`
- CSS `padding-left`
- CSS `padding-right`
- CSS `padding-top`
- CSS `pointer-events`
- CSS `position`
- CSS `right`
- CSS `stroke`
- CSS `stroke-dasharray`
- CSS `stroke-dashoffset`
- CSS `stroke-width`
- CSS `text-align`
- CSS `text-decoration`
- CSS `text-indent`
- CSS `text-overflow`
- CSS `text-rendering`
- CSS `text-shadow`
- CSS `text-transform`
- CSS `top`
- CSS `transform`
- CSS `transform-origin`
- CSS `transition`
- CSS `transition-property`
- CSS `transition-timing-function`
- CSS `unicode-bidi`
- CSS `user-select`
- CSS `vertical-align`
- CSS `visibility`
- CSS `webkit-appearance`
- CSS `webkit-background-clip`
- CSS `webkit-box-direction`
- CSS `webkit-box-orient`
- CSS `webkit-filter`
- CSS `webkit-font-smoothing`
- CSS `webkit-user-select`
- CSS `white-space`
- CSS `width`
- CSS `word-spacing`
- CSS `word-wrap`
- CSS `z-index`
- CSS `zoom`

AddEventListenerPassiveTrueなど対応していないことがわかった
たぶんデザインの部分かな・・・・調べてみるしかないな