微信H5页面禁用复制链接

别再手动调样式了!用WeUI v2.6.11快速搞定微信H5页面(附CDN链接和完整示例) 本文介绍了如何使用WeUI v2.6.11快速开发微信H5页面,避免手动调整样式的繁琐工作。WeUI作为微信官方样式库,提供与微信原生界面一致的视觉体验,包括按钮、对话框、消息提示等组件,大幅提升开发效率和用户体验。文章还提供了CDN链接和完整示例,帮助开发者快速上手。 阅读详情

微信开发文档 : https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#0

<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
    $.ajax({
        url:"/wxconfig",
        type:"get",
        data:{"url": window.location.href},
        success:function (res) {
            if(res.code == 200){
                wx.config({
                    debug: false, // 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。
                    appId: res.data.appId, // 必填,公众号的唯一标识
                    timestamp: res.data.timestamp, // 必填,生成签名的时间戳
                    nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
                    signature: res.data.signature,// 必填,签名
                    jsApiList: ['hideAllNonBaseMenuItem'] // 必填,需要使用的 JS 接口列表
                });

                wx.ready(function () {
                    wx.hideAllNonBaseMenuItem(); //隐藏所有非基础按钮接口
                });

                wx.error(function(res){
                    console.log(res)
                });
            }
        },
        error:function () {

        }
    });
</script>

服务端生成签名

//获取jsapi_ticket
$jsapiTicket = '';

$timestamp = time();  //时间戳
$nonceStr = time().rand(1,9999); //随机数

//url 当前H5页面url
$param = 'jsapi_ticket='.jsapiTicket.'&noncestr='.$nonceStr.'&timestamp='.$timestamp.'&url='.$url;
$signature = sha1($param);

$config = [
    'appId'=>'微信公众号appid',
    'timestamp'=>$timestamp,
    'nonceStr'=>$nonceStr,
    'signature'=>$signature,
];
return json_encode([
    'code'=>200,
    'msg'=>'SUCCESS',
    'data'=>$config
]);

jsapi_ticket

生成签名之前必须先了解一下jsapi_ticket,jsapi_ticket是公众号用于调用微信 JS 接口的临时票据。正常情况下,jsapi_ticket的有效期为7200秒,通过access_token来获取。由于获取jsapi_ticket的 api 调用次数非常有限,频繁刷新jsapi_ticket会导致 api 调用受限,影响自身业务,开发者必须在自己的服务全局缓存jsapi_ticket 。

  1. 参考以下文档获取access_token(有效期7200秒,开发者必须在自己的服务全局缓存access_token):https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_access_token.html

  2. 用第一步拿到的access_token 采用http GET方式请求获得jsapi_ticket(有效期7200秒,开发者必须在自己的服务全局缓存jsapi_ticket):https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi

微信游览器进入页面自动播放视频 https://github.com/phoboslab/jsmpeg https://blog.youkuaiyun.com/luwieer/article/details/115438086 mp4转ts 页面中使用: <script src="js/base/jsmpeg.min.js"></script> let player = new JSMpeg.Player('images/out2.ts',{canvas:document.getElementById('canvas' 阅读详情

相关推荐

微信H5下载困境:从技术限制到用户体验的深度解析

本文深度解析微信H5下载的技术限制与用户体验问题,探讨了从基础跳转方案到微信JS-SDK进阶方案的技术实现与局限,并提供了优化用户体验的关键策略。文章还分析了安全与体验的平衡之道,帮助开发者和产品经理在微信生态中实现高效文件下载。

weixin_28520495的博客 442

微信H5页面禁止分享给好友和朋友圈及屏蔽微信复制链接功能

分享到Weibo:"menuItem:share:weiboApp"发送给朋友:"menuItem:share:appMessage"分享到朋友圈:"menuItem:share:timeline"分享到FB:"menuItem:share:facebook"分享到QQ空间:"menuItem:share:QZone"一些特殊公众号:"menuItem:share:brand"分享到QQ: "menuItem:share:qq"邮件:"menuItem:share:email"

細水、長流√的专栏 5103

微信H5支付调不起?weixin://wap/pay与prepayid全链路排查指南

在移动端H5页面集成微信支付时,开发者常遇到后端已返回weixin://wap/pay链接却无法拉起微信客户端的困境。这本质上是URI Scheme调用机制、环境差异与参数传递共同作用的结果。从通用技术原理看,scheme跳转依赖系统协议分发,而prepayid作为预支付标识的透传准确性直接影响支付确认页的加载。理解Android与iOS在Scheme和Universal Link上的差异,以及微信内置浏览器、授权域名配置、参数编码等基础环节,是定位问题的关键。本文从支付链路概念出发,剖析高频故障场景,提供

weixin_33805743的博客 536

禁止微信H5页面点击右上角菜单时出现复制链接,但支持转发给好友和分享到朋友圈...

可以使用 JavaScript 来禁止点击右上角菜单时出现复制链接的功能。可以在页面的 JavaScript 代码中添加如下代码: document.addEventListener('contextmenu', function(e){ e.preventDefault(); }, false); 这样就可以禁止右键菜单了。 同时可以使用如下代码来支持转发给好友和分享到朋友圈: &lt...

weixin_35751194的博客 1767

揭秘微信内置浏览器调试技巧:三步解锁F12开发者工具

本文详细揭秘了在微信PC版内置浏览器中解锁F12开发者工具的实用技巧。通过定位资源目录、放置devtools_resources.pak文件、添加remote-debugging-port启动参数三个核心步骤,帮助前端开发者成功激活调试功能,从而高效排查微信内H5页面的样式、脚本及网络请求问题,提升开发调试效率。

alice7model的博客 1263

40岁从智驾转具身智能之路

我的工作经历比较复杂,本科毕业后工作2年再次读研的,本科和硕士都是机械专业,硕士毕业后干了5年CAM和机器人再转入到自动驾驶行业。在自动驾驶干了8年,发现自动驾驶已经到了一个瓶颈,再次转行做具身智能。我就谈谈自己的最近这次转型之路。

hzm8341的博客 638

微信H5页面禁止分享朋友和复制链接

微信H5页面禁止分享朋友和复制链接

S筱潇S四维Smile 2791

C语言版数字锁相放大器实现指南:从复数运算到嵌入式MCU移植的坑我都帮你踩了

本文详细介绍了C语言实现数字锁相放大器的关键技术,包括复数运算优化、嵌入式MCU移植的实战经验及内存管理策略。针对STM32等资源受限平台,提供了从浮点到定点数转换的优化方案,帮助工程师高效处理微弱信号提取问题。

weixin_30721077的博客 432

微信h5禁止分享和复制链接 超简单

document.addEventListener("WeixinJSBridgeReady", function onBridgeReady() { console.log("关闭分享复制链接") WeixinJSBridge.call("hideOptionMenu"); });

WMW_wmw的博客 2905

企业微信获取code,URL详解

“https://open.weixin.qq.com/connect/oauth2/authorize?”+ “appid=”企业ID “&redirect_uri=”重定向路径+ “&agentid=”小程序AgentId+ “&response_type=code&scope=snsapi_userinfo&state=123&conn...

weixin_44804985的博客 8733

关于VS2022创建winform窗体后择项或选择工具箱项加载visionPro控件卡住,窗口未响应解决方法

解决winform加载工具箱选择项卡死问题

xiaokiss_的博客 3210

微信h5页面右上角分享禁用项纪录

微信h5页面右上角分享禁用项纪录 wx.hideMenuItems({ menuList: [ "menuItem:share:appMessage", // 发送给朋友 "menuItem:share:timeline", // 分享到朋友圈 "menuItem:share:qq", // 分享到QQ "menuItem:share:weiboApp", // 分享到Weibo "menuItem:favorite", // 收藏

莉兹Liz的博客 761

Spyglass实战指南:跨时钟域同步方案深度解析

本文深度解析了Spyglass在跨时钟域同步方案验证中的实战应用。通过真实案例阐述了亚稳态的危害,并详细介绍了从基础的两级同步器到复杂的异步FIFO与握手协议等八大同步方案,以及如何利用Spyglass进行有效配置、检查与问题排查,为提升芯片设计可靠性提供系统性的避坑指南。

weixin_29219189的博客 838

微信屏蔽js分享、复制链接,禁止微信外打开网站

1、屏蔽公众号的复制分享功能 <script type="text/javascript"> $(function(){ function onBridgeReady() { WeixinJSBridge.call('hideOptionMenu'); } if (typeof WeixinJSBridge == "undefined") { if (document..

zhu479的博客 3241

实战详细讲解Qt插件plugin的编写与用法

qt插件的开发,可以说是动态库的开发,因为调用方式类似,多熟悉一下,利用Qt框架开发很简单的。在想想这种调用过程有的熟悉,比如公司买了一堆摄像头,公司要对摄像头进行二次开发,实现自己想要的功能,集成到一套设备里去,然后在卖给用户。此时厂商肯定会提供开发文档,并给你SDK包(软件开发工具包), 包里你会发现只有头文件和一堆库文件,没有源文件,因为实现的过程是产商公司保密的,给你看还得了。所以都封装成了库的形式给你调用,如静态库或者动态库。

qq_44667165的博客 1万+

深度解读 ABAP CDS View 中的 @Analytics.dataCategory: #FACT 注解

注解在 ABAP CDS View 中具有重要意义。它不仅定义了当前视图在数据模型中的角色,还为后续的分析和报告奠定了基础。在实际开发中,通过合理使用这一注解,可以显著提升数据模型的可用性和系统性能。无论是简单的 KPI 展示还是复杂的多维分析,这一注解都能发挥关键作用。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 787

微信小程序web-view 嵌入h5页面

web-view | 微信开放文档 具体可以参考微信开放文档中web-view 微信小程序 wxml <web-view src="{{kocUrl}}"></web-view> js const app = getApp(); Page({ /** * 页面的初始数据 */ data: { kocUrl: '' }, /** * 生命周期函数--监听页面加载 */

m0_55969466的博客 1306

Qlib:微软开源的AI量化投资平台 极简入门快速上手教程:使用 Qlib 进行中芯国际股价回测和预测

Qlib是由微软开源的面向AI量化投资的工具包。它提供了构建量化投资模型所需的基础设施,旨在帮助研究者和从业人员更高效地进行量化研究和策略开发。

AI天才研究院 5413

vue微信H5长按无法弹出识别二维码

一、场景 使用vue写了一个H5项目,然后在IOS微信公众号里可以长按识别二维码,以便用户关注,但是发现在微信公众号无法弹出识别。 vue的路由是默认的:hash。 二、查找原因 网上搜索了很多方案,修改样式、尺寸大小、甚至加上logo,都是无法成功。 如果单独的写一个静态页面,放一张图片,然后在微信公众号里是可以识别。 但是只要在vue搭建的项目里,就是无法访问,就单独放一个图片也不...

希望能找到你的答案 6848

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

h5 唤起app或跳转appStore

//唤起app通过唤端媒介(URL Scheme) //微信浏览器自6.3.x版本起禁用了大多数Scheme跳转功能,扫一扫目前可用 // URL 的组成: // [scheme:][//authority][path][?query][#fragment] //比如:&lt;a href="weixin://scanqrcode"&gt;打开微信扫一扫&lt;/a&gt; ...

weixin_34306593的博客 4741

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

H5白屏问题

前言 前阵子弄了灰度环境,H5这边需要给灰度环境的接口加上Cookie,配置的期间遇到一些Cookie问题以及白屏在此记录下 1、H5请求接口带不上Cookie 解决方法:前端使用了 webpack 对项目进行打包,其中 crossOriginLoading 这一项配置的是 anonymous,由于配置错了,导致Cookie带不上 `crossOriginLoading`此选...

weixin_30739595的博客 2590

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【前端】禁用移动浏览器长按默认事件

转载:H5移动端禁止长按弹出系统菜单"选择复制",“在浏览器打开” 移动端长按事件自定义的时候会和各种浏览器自带的长按默认事件冲突,所以禁止掉浏览器自带的长按事件 *{ -webkit-touch-callout:none;/*系统默认菜单被禁用*/ -webkit-user-select:none;/*webkit浏览器*/ -khtml-user-select:none;/*早起浏览器*/ -moz-user-select:none;/*火狐浏览器*/ -ms-user-select:none

weixin_38792911的博客 5097

前端白屏问题_H5白屏问题

前言前阵子弄了灰度环境,H5这边需要给灰度环境的接口加上Cookie,配置的期间遇到一些Cookie问题以及白屏在此记录下1、H5请求接口带不上Cookie解决方法:前端使用了 webpack 对项目进行打包,其中 crossOriginLoading 这一项配置的是 anonymous,由于配置错了,导致Cookie带不上`crossOriginLoading`此选项可以启用跨域加载(cross...

weixin_39569753的博客 3078

微信H5中tel链接点击无反应?从原理到实践的完整排查与封装方案

在移动端H5开发中,通过tel协议唤起系统拨号盘是常见的交互方式,但微信内置浏览器(Android端基于X5内核,iOS端基于WKWebView)对链接跳转的管控更为复杂,导致开发者频繁遇到“点击无反应”或“白屏闪退”等问题。理解tel协议作为RFC 3966标准URI的基本原理,以及浏览器容器与操作系统间的协作机制,是定位问题的前提。从技术价值来看,掌握正确的号码格式、规避target空白页、处理透明遮罩和事件拦截等常见陷阱,能有效提升拨号功能的稳定性和用户转化率。应用场景涵盖公众号H5、房产推广页、客服

weixin_32349561的博客 105

Android手机H5 打开 excel文件失败

Excel,开发者,服务器相关视频讲解:用python编程Excel有没有用处?美国禁用中国大学MATLAB快四年,国产替代完成了吗?实现一个乞丐版四层负载均衡器如何在Android手机H5中成功打开excel文件 作为一名经验丰富的开发者,我将教会你如何实现在Android手机H5中成功打开excel文件的方法。首...

weixin_37042544的博客 169
上一篇: laravel 多库配置
下一篇: winform 自动获取默认打印机并打印图片
~断点~
博客等级 码龄9年 6粉丝 11原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值