标签: web-applications

如何允许不安全评估和远程脚本 - CSP内容安全策略

"GOOGLE EXTENSION WEB APP"

让我疯狂.

我无法设法使用unsafe-eval和远程脚本.

我可以有不安全的eval,但删除脚本不起作用.反之亦然.

什么失败了:

评估和远程

"content_security_policy": "script-src https://connect.facebook.net 'unsafe-eval'; object-src 'self' "

什么有效:

只有远程

"content_security_policy": "script-src 'self' https://connect.facebook.net; object-src 'self' "

只有Eval

"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self' "

如何兼得?

google-chrome web-applications google-chrome-extension content-security-policy

0
推荐指数
1
解决办法
4876
查看次数

序列化为XML

我一直在互联网上搜索,但找不到任何帮助.我的问题是serialize一个arraylistxml.我首先从数据库中收集数据并将其分配给arraylist,如下所示,

    ArrayList conRc = new ArrayList();        
    while (readIp.Read())
    {
        string ipVal = readIp.GetString(0);
        string conLvlVal = readIp.GetString(1);
        string ispVal = readIp.GetString(2);
        string tsVal = readIp.GetString(3);
        ispVal = ispVal.Trim();
        ispVal = ispVal.Replace("\"", "");
        string localPortVal = readIp.GetString(4);
        string foeriegnGeoVal = readIp.GetString(5);


        conRc.Add(new Confidence(tsVal, ipVal, localPortVal, ispVal, foeriegnGeoVal, conLvlVal));


    }
Run Code Online (Sandbox Code Playgroud)

并尝试按如下方式序列化arraylist,

    System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(ArrayList));
    System.IO.TextWriter writer = new System.IO.StreamWriter(@"F:\myItems.xml", false);
    serializer.Serialize(writer, conRc);
    writer.Close();
Run Code Online (Sandbox Code Playgroud)

但我得到一个错误说,

There was an error generating the XML document.

我可以知道如何执行这项任务......这将是一个很好的帮助.

仅供参考,下面是 …

c# asp.net web-applications xml-serialization

0
推荐指数
1
解决办法
215
查看次数

ExpressJS中的分布式会话存储

我正在开发分布式Web应用程序,我想使用ExpressJS会话来存储数据,因此我需要一个分布式会话存储.或者,我可以构建自己的会话存储,但我不知道该怎么做.

我在项目的某些部分使用memcached(通过此模块)与Web应用程序不同,因此能够将memcached用作会话存储可能会很好.

我想要这样的东西:

app.use(express.session({secret: 'something', store: new MemcachedStorage(...)}));
Run Code Online (Sandbox Code Playgroud)

那么我应该使用什么存储?

javascript session web-applications node.js express

0
推荐指数
1
解决办法
989
查看次数

应用程序在Android中意外关闭

我无法弄清楚为什么我的简单webview应用程序意外关闭的原因.即使Eclipse没有抛出任何错误.

这是截图http://pbrd.co/YNWFVw

MainActivity.java:

package com.example.testwebview;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.webkit.WebView;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        WebView webView1 = (WebView) findViewById(R.id.webView1);
        webView1.loadUrl("http://www.google.com/m");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

}
Run Code Online (Sandbox Code Playgroud)

activity_main.xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

    <WebView
        android:id="@+id/webView1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" …
Run Code Online (Sandbox Code Playgroud)

android web-services web-applications web

0
推荐指数
1
解决办法
636
查看次数

net beans 7.3中没有Web应用程序选项

我已经安装了NetBeans IDE 7.3.我需要从中做JSP项目.但我在文件 - >新项目中找不到Web应用程序选项.

有没有要安装的插件?不然我该怎么办?

java web-applications netbeans-7.3

0
推荐指数
1
解决办法
5983
查看次数

使用jquery为每个添加事件处理程序

我如何一起使用.on和.each?

$('[id^="thing"]').each(???)
Run Code Online (Sandbox Code Playgroud)

一个是:

 $("#button").on("click", function() {
                    console.log(this.id)
 })
Run Code Online (Sandbox Code Playgroud)

html javascript jquery web-applications

0
推荐指数
1
解决办法
79
查看次数

使用不同的数据参数化JUnit测试

我正在研究一个可能导致我滥用JUnit的Java webapp.我正在构建一个用于运行JUnit测试的多用户界面.这很容易,但我无法找到一种方法来指示用户A想要使用数据X对JUnit测试类进行参数化,并且用户B想要使用数据Y进行参数化.

这甚至可能吗?如果没有,我会感激任何建议.谢谢.

java junit web-applications

0
推荐指数
1
解决办法
117
查看次数

How do I enforce unique user names in Flask?

I'm a complete beginner to Flask and I'm starting to play around with making web apps.

I have a hard figuring out how to enforce unique user names. I'm thinking about how to do this in SQL, maybe with something like user_name text unique on conflict fail, but then how to I catch the error back in Python?

Alternatively, is there a way to manage this that's built in to Flask?

python sql web-applications flask

0
推荐指数
1
解决办法
331
查看次数

如何创建自动应用程序导览/演练?

我正在创建一个基于angular-js的Web应用程序.我想创建一个自动演练/应用程序之旅 - 就像我们在google或facebook上看到他们发布一些新功能/按钮时.

这是向社区询问他们是否可以指导我学习一些教程.另外,我想创建指向我的功能的文本框,比如应用程序中的一些按钮.如何确保此文本框与按钮位于同一位置?

javascript jquery user-interface web-applications angularjs

0
推荐指数
1
解决办法
755
查看次数

如何让移动浏览器保持清醒状态

我正在开发一个播放mp3文件播放列表的网络应用程序,我在移动浏览器上遇到了一个问题.我将开始播放一首歌并立即关闭屏幕.该网站将继续运行并播放2-3首歌曲.之后它停止播放.我只在android上用chrome测试了这个.

我能做些什么来保持音乐播放?

javascript mobile web-applications

0
推荐指数
1
解决办法
3322
查看次数