【问题标题】:how to hide source code like on lionsgate's website?如何像 Lionsgate 的网站一样隐藏源代码?
【发布时间】:2019-07-11 05:07:45
【问题描述】:

我想问你如何隐藏源代码,就像在 Lionsgate 的网站上一样:https://www.lionsgate.com/

如果您前往:查看源代码:https://www.lionsgate.com/ 以下是查看源代码:

<html class="no-js">
<!--<![endif]-->

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimal-ui, viewport-fit=cover">
    <meta name="apple-mobile-web-app-title" content="">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="google-site-verification" content="_EvDO8qIZmbl1NWIapBahEQsFlFGFPsfJQnLfFXU1To" />

    <!-- <meta property="og:title" content="LIONSGATE" />
    <meta property="og:description" content="Lionsgate is a global content platform whose films, television series, digital products and linear and over-the-top platforms reach next generation audiences around the world." />
    <meta property="og:image" name="Lionsgate" content="/media/images/logo-ogimage.jpg" />

    <meta property="og:url" content="https://www.Lionsgate.com" />    
    <meta property="og:type" content="Entertainment" />
    <meta property="og:site_name" content="Lionsgate.com - Official Company Website" /> -->

    <link rel="apple-touch-icon" sizes="180x180" href="/media/favicon/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/media/favicon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/media/favicon/favicon-16x16.png">
    <link rel="manifest" href="/media/favicon/site.webmanifest">
    <meta name="msapplication-TileColor" content="#2b5797">
    <meta name="theme-color" content="#ffffff">


    <!-- experimental GTM  -->
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-T9Q8QNQ');</script>
    <!-- End Google Tag Manager -->
    <!-- //experimental GTM  -->




    <!-- BEGIN Salesforce DMP ControlTag for "http://lionsgate.com" -->
    <script class="kxct" data-id="Kwl-bwdx" data-timing="async" data-version="3.0" type="text/javascript">
        window.Krux||((Krux=function(){Krux.q.push(arguments)}).q=[]);
        (function(){
        var k=document.createElement('script');k.type='text/javascript';k.async=true;
        k.src=(location.protocol==='https:'?'https:':'http:')+'//cdn.krxd.net/controltag/Kwl-bwdx.js';
        var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(k,s);
        }());
    </script>
    <!-- END Salesforce DMP ControlTag -->
<link href="/css/style.0a622347abc8901f65ef.css" rel="stylesheet"></head>

<body>

    <div id="root"></div>
<script type="text/javascript" src="/js/main.0a622347abc8901f65ef.js"></script></body>

</html>

如你所见,几乎没有 html 代码,只有

你们中有人知道我怎样才能以这种方式加密/隐藏代码吗?

非常感谢:)

【问题讨论】:

  • 代码未加密
  • 您使用的是单页应用程序;所有工作都由 JavaScript 完成。
  • 作为一般经验法则,您无法在用户自己的计算机上隐藏任何内容。如果您有确实想对用户隐藏的信息,请不要将其发送给他们!

标签: javascript html security encryption


【解决方案1】:

源代码没有隐藏。这里是:https://www.lionsgate.com/js/main.0a622347abc8901f65ef.js

我建议您阅读有关single-page react application 的更多信息。

简而言之,他们加载了一个javascript bundle,它将他们的 HTML 呈现到页面中,而不是在服务器端呈现 HTML。这是一种非常常见的方法,适用于 react 等客户端框架。

它们不会混淆或隐藏任何东西。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-14
    • 1970-01-01
    • 2013-08-16
    • 1970-01-01
    • 1970-01-01
    • 2014-01-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多