Skip to main content

Custom Script Widget.js Blogger

Seingat saya kalau tidak salah, trik menyembunyikan widget.js blogger dimulai oleh Maskolis dengan tujuan untuk mempercepat loading blog. Script widget.js blogger ini menurut saya sih seperti siluman hehehe... Tidak ada di edit HTML namun ada di source blog yang biasanya muncul di atas kode </body>.

Selain widget.js blogger yang membuat berat loading blog karena tidak asynchronous, terdapat juga google plus JS plusone.js yang juga tidak asynchronous seperti di bawah ini.


<script type="text/javascript">
if (window.jstiming) window.jstiming.load.tick('widgetJsBefore');
</script>
<script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/278981662-widgets.js"></script>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

<script type='text/javascript'>
if (typeof(BLOG_attachCsiOnload) != 'undefined' && BLOG_attachCsiOnload != null) { window['blogger_templates_experiment_id'] = "templatesV1";window['blogger_blog_id'] = '2583045784323695327';BLOG_attachCsiOnload('item_'); }........
...........
...........
</script>

Selain kedua JS tersebut yang disembunyikan, kode-kode di bawahnya pun ikut menjadi tersembunyi. Namun setelah lama saya gunakan trik menyembunyikan widget.js ini, saya perhatikan ada kode-kode yang mungkin berguna untuk blog yang sama dengan kode-kode All Head Content.

Untuk itu saya mencoba menyimpan secara manual script widget blogger ini dengan tetap menyembunyikan script aslinya namun tanpa menyertakan widget.js dan plusone.js.

Nah bagi blog yang templatenya menggunakan kode &lt;!--</body>--&gt;&lt;/body&gt; silahkan coba gunakan custom script widget.js blogger di bawah ini dan simpan di atas kode &lt;!--</body>--&gt;&lt;/body&gt;

Karena script untuk halaman index sedikit berbeda dengan halaman postingan dan halaman statis, maka script-nya saya buat 3 kelompok untuk halaman index dan untuk halaman postingan dan halaman statis.


<b:if cond='data:blog.pageType != &quot;item&quot; and data:blog.pageType != &quot;static_page&quot;'>
<script type='text/javascript'>
if (typeof(BLOG_attachCsiOnload) != "undefined" &amp;&amp; BLOG_attachCsiOnload != null) { window["blogger_templates_experiment_id"] = "templatesV1";window["blogger_blog_id"] = "<data:blog.blogId/>";BLOG_attachCsiOnload(""); }_WidgetManager._Init("//www.blogger.com/rearrange?blogID\x3d<data:blog.blogId/>","<data:blog.url/>","<data:blog.blogId/>");
_WidgetManager._SetDataContext([{"name": "blog", "data": {"blogId": "<data:blog.blogId/>", "bloggerUrl": "<data:blog.bloggerUrl/>", "title": "<data:blog.title/>", "pageType": "<data:blog.pageType/>", "url": "<data:blog.url/>", "canonicalUrl": "<data:blog.canonicalUrl/>", "homepageUrl": "<data:blog.homepageUrl/>", "canonicalHomepageUrl": "<data:blog.canonicalHomepageUrl/>", "blogspotFaviconUrl": "<data:blog.blogspotFaviconUrl/>", "enabledCommentProfileImages": <data:blog.enabledCommentProfileImages/>, "adultContent": <data:blog.adultContent/>, "analyticsAccountNumber": "<data:blog.analyticsAccountNumber/>", "useUniversalAnalytics": <data:blog.useUniversalAnalytics/>, "pageName": "", "pageTitle": "<data:blog.pageTitle/>", "metaDescription": "<data:blog.metaDescription/>", "encoding": "<data:blog.encoding/>", "locale": "<data:blog.locale/>", "localeUnderscoreDelimited": "<data:blog.localeUnderscoreDelimited/>", "isPrivate": <data:blog.isPrivate/>, "isMobile": <data:blog.isMobile/>, "isMobileRequest": <data:blog.isMobileRequest/>, "mobileClass": "", "isPrivateBlog": <data:blog.isPrivateBlog/>, "languageDirection": "<data:blog.languageDirection/>", "feedLinks": "\74link rel\75\42alternate\42 type\75\42application/atom+xml\42 title\75\42<data:blog.title/> - Atom\42 href\75\42<data:blog.homepageUrl/>feeds/posts/default\42 /\76\n\74link rel\75\42alternate\42 type\75\42application/rss+xml\42 title\75\42<data:blog.title/> - RSS\42 href\75\42<data:blog.homepageUrl/>feeds/posts/default?alt\75rss\42 /\76\n\74link rel\75\42service.post\42 type\75\42application/atom+xml\42 title\75\42<data:blog.title/> - Atom\42 href\75\42<data:blog.bloggerUrl/>/feeds/<data:blog.blogId/>/posts/default\42 /\76\n", "meTag": "\74link rel\75\42me\42 href\75\42<data:blog.googleProfileUrl/>\42 /\76\n", "openIdOpTag": "", "googleProfileUrl": "<data:blog.googleProfileUrl/>", "latencyHeadScript": "\74script type\75\42text/javascript\42\76(function() { (function(){function c(a){this.t\75{};this.tick\75function(a,c,b){var d\75void 0!\75b?b:(new Date).getTime();this.t[a]\75[d,c];if(void 0\75\75b)try{window.console.timeStamp(\42CSI/\42+a)}catch(e){}};this.tick(\42start\42,null,a)}var a;window.performance\46\46(a\75window.performance.timing);var h\75a?new c(a.responseStart):new c;window.jstiming\75{Timer:c,load:h};if(a){var b\75a.navigationStart,e\75a.responseStart;0\74b\46\46e\76\75b\46\46(window.jstiming.srt\75e-b)}if(a){var d\75window.jstiming.load;0\74b\46\46e\76\75b\46\46(d.tick(\42_wtsrt\42,void 0,b),d.tick(\42wtsrt_\42,\n\42_wtsrt\42,e),d.tick(\42tbsd_\42,\42wtsrt_\42))}try{a\75null,window.chrome\46\46window.chrome.csi\46\46(a\75Math.floor(window.chrome.csi().pageT),d\46\0460\74b\46\46(d.tick(\42_tbnd\42,void 0,window.chrome.csi().startE),d.tick(\42tbnd_\42,\42_tbnd\42,b))),null\75\75a\46\46window.gtbExternal\46\46(a\75window.gtbExternal.pageT()),null\75\75a\46\46window.external\46\46(a\75window.external.pageT,d\46\0460\74b\46\46(d.tick(\42_tbnd\42,void 0,window.external.startE),d.tick(\42tbnd_\42,\42_tbnd\42,b))),a\46\46(window.jstiming.pt\75a)}catch(k){}})();window.tickAboveFold\75function(c){var a\0750;if(c.offsetParent){do a+\75c.offsetTop;while(c\75c.offsetParent)}c\75a;750\76\75c\46\46window.jstiming.load.tick(\42aft\42)};var f\75!1;function g(){f||(f\75!0,window.jstiming.load.tick(\42firstScrollTime\42))}window.addEventListener?window.addEventListener(\42scroll\42,g,!1):window.attachEvent(\42onscroll\42,g);\n })();\74/script\076", "mobileHeadScript": "", "view": "", "dynamicViewsCommentsSrc": "<data:blog.dynamicViewsCommentsSrc/>", "dynamicViewsScriptSrc": "<data:blog.dynamicViewsScriptSrc/>", "plusOneApiSrc": "<data:blog.plusOneApiSrc/>", "sf": "<data:blog.sf/>"}}, {"name": "messages", "data": {"archive": "Archive", "deleteBacklink": "Delete Backlink", "deleteComment": "Delete Comment", "emailAddress": "Email Address", "getEmailNotifications": "Get email notifications", "keepReading": "Keep reading", "labels": "Labels", "loadMorePosts": "Load more posts", "loading": "Loading...", "myBlogList": "My Blog List", "myFavoriteSites": "My favorite sites", "newer": "Newer", "newerPosts": "Newer Posts", "newest": "Newest", "noResultsFound": "No results found", "noTitle": "No title", "older": "Older", "olderPosts": "Older Posts", "oldest": "Oldest", "onlyTeamMembersCanComment": "Note: Only a member of this blog may post a comment.", "popularPosts": "Popular Posts", "popularPostsFromThisBlog": "Popular posts from this blog", "postAComment": "Post a Comment", "reportAbuse": "Report Abuse", "search": "Search", "share": "Share", "showAll": "Show all", "subscribe": "Subscribe", "subscribeToThisBlog": "Subscribe to this blog", "theresNothingHere": "There\47s nothing here!"}}, {"name": "skin", "data": {"vars": {}, "override": ""}}, {"name": "view", "data": {"classic": {"name": "classic", "url": "?view\75classic"}, "flipcard": {"name": "flipcard", "url": "?view\75flipcard"}, "magazine": {"name": "magazine", "url": "?view\75magazine"}, "mosaic": {"name": "mosaic", "url": "?view\75mosaic"}, "sidebar": {"name": "sidebar", "url": "?view\75sidebar"}, "snapshot": {"name": "snapshot", "url": "?view\75snapshot"}, "timeslide": {"name": "timeslide", "url": "?view\75timeslide"}}}]);
</script>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<script type='text/javascript'>
if (typeof(BLOG_attachCsiOnload) != "undefined" &amp;&amp; BLOG_attachCsiOnload != null) { window["blogger_templates_experiment_id"] = "templatesV1";window["blogger_blog_id"] = "<data:blog.blogId/>";BLOG_attachCsiOnload("<data:blog.pageType/>_"); }_WidgetManager._Init("//www.blogger.com/rearrange?blogID\x3d<data:blog.blogId/>","<data:blog.url/>","<data:blog.blogId/>");
_WidgetManager._SetDataContext([{"name": "blog", "data": {"blogId": "<data:blog.blogId/>", "bloggerUrl": "<data:blog.bloggerUrl/>", "title": "<data:blog.title/>", "pageType": "<data:blog.pageType/>", "postId": "<data:blog.postId/>", "url": "<data:blog.url/>", "canonicalUrl": "<data:blog.canonicalUrl/>", "homepageUrl": "<data:blog.homepageUrl/>", "canonicalHomepageUrl": "<data:blog.canonicalHomepageUrl/>", "blogspotFaviconUrl": "<data:blog.blogspotFaviconUrl/>", "enabledCommentProfileImages": <data:blog.enabledCommentProfileImages/>, "adultContent": <data:blog.adultContent/>, "analyticsAccountNumber": "<data:blog.analyticsAccountNumber/>", "useUniversalAnalytics": <data:blog.useUniversalAnalytics/>, "pageName": "<data:blog.pageName/>", "pageTitle": "<data:blog.pageTitle/>", "metaDescription": "<data:blog.metaDescription/>", "encoding": "<data:blog.encoding/>", "locale": "<data:blog.locale/>", "localeUnderscoreDelimited": "<data:blog.localeUnderscoreDelimited/>", "isPrivate": <data:blog.isPrivate/>, "isMobile": <data:blog.isMobile/>, "isMobileRequest": <data:blog.isMobileRequest/>, "mobileClass": "", "isPrivateBlog": <data:blog.isPrivateBlog/>, "languageDirection": "<data:blog.languageDirection/>", "feedLinks": "\74link rel\75\42alternate\42 type\75\42application/atom+xml\42 title\75\42<data:blog.title/> - Atom\42 href\75\42<data:blog.homepageUrl/>feeds/posts/default\42 /\76\n\74link rel\75\42alternate\42 type\75\42application/rss+xml\42 title\75\42<data:blog.title/> - RSS\42 href\75\42<data:blog.homepageUrl/>feeds/posts/default?alt\75rss\42 /\76\n\74link rel\75\42service.post\42 type\75\42application/atom+xml\42 title\75\42<data:blog.title/> - Atom\42 href\75\42<data:blog.bloggerUrl/>/feeds/<data:blog.blogId/>/posts/default\42 /\76\n\n\74link rel\75\42alternate\42 type\75\42application/atom+xml\42 title\75\42<data:blog.title/> - Atom\42 href\75\42<data:blog.homepageUrl/>feeds/<data:blog.postId/>/comments/default\42 /\76\n", "meTag": "\74link rel\75\42me\42 href\75\42<data:blog.googleProfileUrl/>\42 /\76\n", "openIdOpTag": "", "googleProfileUrl": "<data:blog.googleProfileUrl/>", "postImageThumbnailUrl": "<data:blog.postImageThumbnailUrl/>", "postImageUrl": "<data:blog.postImageUrl/>", "latencyHeadScript": "\74script type\75\42text/javascript\42\76(function() { (function(){function c(a){this.t\75{};this.tick\75function(a,c,b){var d\75void 0!\75b?b:(new Date).getTime();this.t[a]\75[d,c];if(void 0\75\75b)try{window.console.timeStamp(\42CSI/\42+a)}catch(e){}};this.tick(\42start\42,null,a)}var a;window.performance\46\46(a\75window.performance.timing);var h\75a?new c(a.responseStart):new c;window.jstiming\75{Timer:c,load:h};if(a){var b\75a.navigationStart,e\75a.responseStart;0\74b\46\46e\76\75b\46\46(window.jstiming.srt\75e-b)}if(a){var d\75window.jstiming.load;0\74b\46\46e\76\75b\46\46(d.tick(\42_wtsrt\42,void 0,b),d.tick(\42wtsrt_\42,\n\42_wtsrt\42,e),d.tick(\42tbsd_\42,\42wtsrt_\42))}try{a\75null,window.chrome\46\46window.chrome.csi\46\46(a\75Math.floor(window.chrome.csi().pageT),d\46\0460\74b\46\46(d.tick(\42_tbnd\42,void 0,window.chrome.csi().startE),d.tick(\42tbnd_\42,\42_tbnd\42,b))),null\75\75a\46\46window.gtbExternal\46\46(a\75window.gtbExternal.pageT()),null\75\75a\46\46window.external\46\46(a\75window.external.pageT,d\46\0460\74b\46\46(d.tick(\42_tbnd\42,void 0,window.external.startE),d.tick(\42tbnd_\42,\42_tbnd\42,b))),a\46\46(window.jstiming.pt\75a)}catch(k){}})();window.tickAboveFold\75function(c){var a\0750;if(c.offsetParent){do a+\75c.offsetTop;while(c\75c.offsetParent)}c\75a;750\76\75c\46\46window.jstiming.load.tick(\42aft\42)};var f\75!1;function g(){f||(f\75!0,window.jstiming.load.tick(\42firstScrollTime\42))}window.addEventListener?window.addEventListener(\42scroll\42,g,!1):window.attachEvent(\42onscroll\42,g);\n })();\74/script\076", "mobileHeadScript": "", "view": "", "dynamicViewsCommentsSrc": "<data:blog.dynamicViewsCommentsSrc/>", "dynamicViewsScriptSrc": "<data:blog.dynamicViewsScriptSrc/>", "plusOneApiSrc": "<data:blog.plusOneApiSrc/>", "sf": "<data:blog.sf/>", "tf": "<data:blog.tf/>"}}, {"name": "messages", "data": {"archive": "Archive", "deleteBacklink": "Delete Backlink", "deleteComment": "Delete Comment", "emailAddress": "Email Address", "getEmailNotifications": "Get email notifications", "keepReading": "Keep reading", "labels": "Labels", "loadMorePosts": "Load more posts", "loading": "Loading...", "myBlogList": "My Blog List", "myFavoriteSites": "My favorite sites", "newer": "Newer", "newerPosts": "Newer Posts", "newest": "Newest", "noResultsFound": "No results found", "noTitle": "No title", "older": "Older", "olderPosts": "Older Posts", "oldest": "Oldest", "onlyTeamMembersCanComment": "Note: Only a member of this blog may post a comment.", "popularPosts": "Popular Posts", "popularPostsFromThisBlog": "Popular posts from this blog", "postAComment": "Post a Comment", "reportAbuse": "Report Abuse", "search": "Search", "share": "Share", "showAll": "Show all", "subscribe": "Subscribe", "subscribeToThisBlog": "Subscribe to this blog", "theresNothingHere": "There\47s nothing here!"}}, {"name": "skin", "data": {"vars": {}, "override": ""}}, {"name": "view", "data": {"classic": {"name": "classic", "url": "?view\75classic"}, "flipcard": {"name": "flipcard", "url": "?view\75flipcard"}, "magazine": {"name": "magazine", "url": "?view\75magazine"}, "mosaic": {"name": "mosaic", "url": "?view\75mosaic"}, "sidebar": {"name": "sidebar", "url": "?view\75sidebar"}, "snapshot": {"name": "snapshot", "url": "?view\75snapshot"}, "timeslide": {"name": "timeslide", "url": "?view\75timeslide"}}}]);
</script>
</b:if>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
<script type='text/javascript'>
if (typeof(BLOG_attachCsiOnload) != "undefined" &amp;&amp; BLOG_attachCsiOnload != null) { window["blogger_templates_experiment_id"] = "templatesV1";window["blogger_blog_id"] = "<data:blog.blogId/>";BLOG_attachCsiOnload("<data:blog.pageType/>_"); }_WidgetManager._Init("//www.blogger.com/rearrange?blogID\x3d<data:blog.blogId/>","<data:blog.url/>","<data:blog.blogId/>");
_WidgetManager._SetDataContext([{"name": "blog", "data": {"blogId": "<data:blog.blogId/>", "bloggerUrl": "<data:blog.bloggerUrl/>", "title": "<data:blog.title/>", "pageType": "<data:blog.pageType/>", "pageId": "<data:blog.pageId/>", "url": "<data:blog.url/>", "canonicalUrl": "<data:blog.canonicalUrl/>", "homepageUrl": "<data:blog.homepageUrl/>", "canonicalHomepageUrl": "<data:blog.canonicalHomepageUrl/>", "blogspotFaviconUrl": "<data:blog.blogspotFaviconUrl/>", "enabledCommentProfileImages": <data:blog.enabledCommentProfileImages/>, "adultContent": <data:blog.adultContent/>, "analyticsAccountNumber": "<data:blog.analyticsAccountNumber/>", "useUniversalAnalytics": <data:blog.useUniversalAnalytics/>, "pageName": "<data:blog.pageName/>", "pageTitle": "<data:blog.pageTitle/>", "metaDescription": "", "encoding": "<data:blog.encoding/>", "locale": "<data:blog.locale/>", "localeUnderscoreDelimited": "<data:blog.localeUnderscoreDelimited/>", "isPrivate": <data:blog.isPrivate/>, "isMobile": <data:blog.isMobile/>, "isMobileRequest": <data:blog.isMobileRequest/>, "mobileClass": "", "isPrivateBlog": <data:blog.isPrivateBlog/>, "languageDirection": "<data:blog.languageDirection/>", "feedLinks": "\74link rel\75\42alternate\42 type\75\42application/atom+xml\42 title\75\42<data:blog.title/> - Atom\42 href\75\42<data:blog.homepageUrl/>feeds/posts/default\42 /\76\n\74link rel\75\42alternate\42 type\75\42application/rss+xml\42 title\75\42<data:blog.title/> - RSS\42 href\75\42<data:blog.homepageUrl/>feeds/posts/default?alt\75rss\42 /\76\n\74link rel\75\42service.post\42 type\75\42application/atom+xml\42 title\75\42<data:blog.title/> - Atom\42 href\75\42<data:blog.bloggerUrl/>/feeds/<data:blog.blogId/>/posts/default\42 /\76\n", "meTag": "", "openIdOpTag": "", "googleProfileUrl": "<data:blog.googleProfileUrl/>", "latencyHeadScript": "\74script type\75\42text/javascript\42\76(function() { (function(){function c(a){this.t\75{};this.tick\75function(a,c,b){var d\75void 0!\75b?b:(new Date).getTime();this.t[a]\75[d,c];if(void 0\75\75b)try{window.console.timeStamp(\42CSI/\42+a)}catch(e){}};this.tick(\42start\42,null,a)}var a;window.performance\46\46(a\75window.performance.timing);var h\75a?new c(a.responseStart):new c;window.jstiming\75{Timer:c,load:h};if(a){var b\75a.navigationStart,e\75a.responseStart;0\74b\46\46e\76\75b\46\46(window.jstiming.srt\75e-b)}if(a){var d\75window.jstiming.load;0\74b\46\46e\76\75b\46\46(d.tick(\42_wtsrt\42,void 0,b),d.tick(\42wtsrt_\42,\n\42_wtsrt\42,e),d.tick(\42tbsd_\42,\42wtsrt_\42))}try{a\75null,window.chrome\46\46window.chrome.csi\46\46(a\75Math.floor(window.chrome.csi().pageT),d\46\0460\74b\46\46(d.tick(\42_tbnd\42,void 0,window.chrome.csi().startE),d.tick(\42tbnd_\42,\42_tbnd\42,b))),null\75\75a\46\46window.gtbExternal\46\46(a\75window.gtbExternal.pageT()),null\75\75a\46\46window.external\46\46(a\75window.external.pageT,d\46\0460\74b\46\46(d.tick(\42_tbnd\42,void 0,window.external.startE),d.tick(\42tbnd_\42,\42_tbnd\42,b))),a\46\46(window.jstiming.pt\75a)}catch(k){}})();window.tickAboveFold\75function(c){var a\0750;if(c.offsetParent){do a+\75c.offsetTop;while(c\75c.offsetParent)}c\75a;750\76\75c\46\46window.jstiming.load.tick(\42aft\42)};var f\75!1;function g(){f||(f\75!0,window.jstiming.load.tick(\42firstScrollTime\42))}window.addEventListener?window.addEventListener(\42scroll\42,g,!1):window.attachEvent(\42onscroll\42,g);\n })();\74/script\076", "mobileHeadScript": "", "view": "", "dynamicViewsCommentsSrc": "<data:blog.dynamicViewsCommentsSrc/>", "dynamicViewsScriptSrc": "<data:blog.dynamicViewsScriptSrc/>", "plusOneApiSrc": "<data:blog.plusOneApiSrc/>", "sf": "<data:blog.sf/>"}}, {"name": "messages", "data": {"archive": "Archive", "deleteBacklink": "Delete Backlink", "deleteComment": "Delete Comment", "emailAddress": "Email Address", "getEmailNotifications": "Get email notifications", "keepReading": "Keep reading", "labels": "Labels", "loadMorePosts": "Load more posts", "loading": "Loading...", "myBlogList": "My Blog List", "myFavoriteSites": "My favorite sites", "newer": "Newer", "newerPosts": "Newer Posts", "newest": "Newest", "noResultsFound": "No results found", "noTitle": "No title", "older": "Older", "olderPosts": "Older Posts", "oldest": "Oldest", "onlyTeamMembersCanComment": "Note: Only a member of this blog may post a comment.", "popularPosts": "Popular Posts", "popularPostsFromThisBlog": "Popular posts from this blog", "postAComment": "Post a Comment", "reportAbuse": "Report Abuse", "search": "Search", "share": "Share", "showAll": "Show all", "subscribe": "Subscribe", "subscribeToThisBlog": "Subscribe to this blog", "theresNothingHere": "There\47s nothing here!"}}, {"name": "skin", "data": {"vars": {}, "override": ""}}, {"name": "view", "data": {"classic": {"name": "classic", "url": "?view\75classic"}, "flipcard": {"name": "flipcard", "url": "?view\75flipcard"}, "magazine": {"name": "magazine", "url": "?view\75magazine"}, "mosaic": {"name": "mosaic", "url": "?view\75mosaic"}, "sidebar": {"name": "sidebar", "url": "?view\75sidebar"}, "snapshot": {"name": "snapshot", "url": "?view\75snapshot"}, "timeslide": {"name": "timeslide", "url": "?view\75timeslide"}}}]);
</script>
</b:if>

Sekarang coba lihat page source blog Anda, maka tampak 2 script widget blogger di paling bawah kode html blog. Yang satu berwarna hitam untuk kode yang kita pasang tadi dan satunya lagi berwarna hijau untuk kode asli script widget blogger yang kita sembunyikan.

Perlu diperhatikan bahwa terkadang tiap template memiliki settingan yang berbeda-beda, oleh karena itu kita harus menyesuaikan dengan kode script widget blogger yang berwarna hijau.

Berbagi itu peduli:

Comment Policy:

Silahkan tuliskan komentar Anda yang sesuai dengan topik postingan halaman ini. Komentar yang berisi tautan tidak akan ditampilkan sebelum disetujui. Untuk komentar out of topics silahkan masuk ke Forum Kompi Ajaib
Buka Komentar
Buka Komentar
Jangan Diklik!

Menarik Untuk Dibaca Juga:


PrivacySitemap
©2021 KOMPI AJAIB