精华内容
下载资源
问答
  • View Page Source-crx插件

    2021-04-01 21:34:41
    语言:English 单击按钮即可访问页面源 只需单击按钮即可轻松查看页面源
  • #View Page Source按钮将View Page Source按钮添加到工具栏。
  • Standard Android Browser does not provide an option in its menu to view the HTML page source. Some workarounds like installing apps and then using Share page from Browser's menu has been described an
    Standard Android 
    Browser does not provide an option in its menu to view the HTML page source. Some workarounds like installing apps and then using
    Share page from 
    Browser's menu has been described and also the use of Javascript and JQuery to add to a page has been detailed, but we are hungry for more. Needless to say, all these methods involve some manual step so I felt the need to find a completely automatic way of doing it.
    

    Of course, to do it I would resort to our old pal AndroidViewClient. This is a very interesting example of its use because it lies far from testing and application or UI.

    And so, without further ado, let me introduce you to the code...


    #! /usr/bin/env monkeyrunner
    '''
    Copyright (C) 2012  Diego Torres Milano
    Created on Oct 12, 2012
    
    @author: diego
    '''
    
    
    import re
    import sys
    import os
    
    # This must be imported before MonkeyRunner and MonkeyDevice,
    # otherwise the import fails.
    # PyDev sets PYTHONPATH, use it
    try:
        for p in os.environ['PYTHONPATH'].split(':'):
            if not p in sys.path:
                sys.path.append(p)
    except:
        pass
    
    try:
        sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src'))
    except:
        pass
    
    from com.dtmilano.android.viewclient import ViewClient
    
    from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
    
    VPS = "javascript:alert(document.getElementsByTagName('html')[0].innerHTML);"
    PACKAGE = 'com.android.browser'
    ACTIVITY = '.BrowserActivity'
    COMPONENT = PACKAGE + "/" + ACTIVITY
    URI = 'http://dtmilano.blogspot.com'
    
    
    device, serialno = ViewClient.connectToDeviceOrExit()
    
    device.startActivity(component=COMPONENT, uri=URI)
    MonkeyRunner.sleep(3)
    
    vc = ViewClient(device=device, serialno=serialno)
    
    device.drag((240, 180), (240, 420), 10, 10)
    
    url = vc.findViewByIdOrRaise('id/url')
    url.touch()
    MonkeyRunner.sleep(1)
    
    device.press('KEYCODE_DEL', MonkeyDevice.DOWN_AND_UP)
    for c in VPS:
        device.type(c)
    device.press('KEYCODE_ENTER', MonkeyDevice.DOWN_AND_UP)
    MonkeyRunner.sleep(3)
    
    vc.dump()
    print vc.findViewByIdOrRaise('id/message').getText().replace('\\n', "\n")
    
    device.press('KEYCODE_BACK', MonkeyDevice.DOWN_AND_UP)
    
    


    And now a brief explanation of the most important pieces of this script.

    1. Shebang, you know, to invoke monkeyrunner as the interpreter. I don't have to tell you more (if you are a poor Windows user you may have to invoke monkeyrunner from command line, I feel sad for you)
    2. Some comments and imports
    3. Read PYTHONPATH just in case you are using Eclipse and Pydev (this has been explained in thispost)
    4. Then use ANDROID_VIEW_CLIENT_HOME environment variable to findAndroidViewClient in your system
    5. Some constants defined. VPS is the actual javascript to obtain the page source
    6. The standard way of connecting to the device or emulator in AndroidViewClient. This handles errors and timeout automatically solving many problems you find with bare monkeyrunner
    7. We start Browser
    8. Drag a bit to make the URL visible in case the page has scrolled
    9. Next, we find the View with ID id/url, which you know, contains the URL
    10. We touch to focus
    11. And type the javascript in VPS followed by ENTER
    12. By that time the alert dialog should be on screen so we take a new dump
    13. Now we find the View with ID id/message which contains theHTML and print it
    14. Finally, we press BACK to dismiss it
    I hope you have enjoyed it as much as I did and this help you find new ways of using AndroidViewClient.

    P.S. This script will be part of AndroidViewClient source code distribution examples

    转载自:http://dtmilano.blogspot.com/search/label/AndroidViewClient

    展开全文
  • view-source是一种协议,查看源码

    万次阅读 2018-03-08 11:19:23
    view-source是一种协议,早期基本上每个浏览器都支持这个协议。后来Microsoft考虑安全性,对于WindowsXP pack2以及更高版本以后IE就不再支持此协议。但是这个方法在FireFox和Chrome浏览器都还可以使用。 如果要在IE...
    view-source是一种协议,早期基本上每个浏览器都支持这个协议。后来Microsoft考虑安全性,对于WindowsXP pack2以及更高版本以后IE就不再支持此协议。但是这个方法在FireFox和Chrome浏览器都还可以使用。 如果要在IE下查看源代码,只能使用查看中的"查看源代码"命令.
     
      以前的使用方法:在浏览器地址栏中输入
      view-source: sURL
      回车即可看到当前网页的源代码了。
     
           JS用法:
           window.location="view-source:" + window.location

    浏览器直接查看源码



    展开全文
  • [转]IE View Source Default Editor

    千次阅读 2005-04-26 10:28:00
    IE View Source Default Editorhttp://www.advantagecommunication.com/blog/tech.htmlAs a web developer, I commonly look at source code, View -> Source, from my web browser, which most of the time is Oper

    IE View Source Default Editor

    http://www.advantagecommunication.com/blog/tech.html

    As a web developer, I commonly look at source code, View -> Source, from my web browser, which most of the time is Opera, but sometimes I am forced to use IE. This poses a pain in the ass since the default editor is the small, but mostly useless, Notepad. So wanting to be able to View Source (available from right-click on the page), and open it in my favorite editor UltraEdit I tryed and tryed, and eventually came up with the following:


    Shutdown IE


    1. Rename Temporary Internet Files


    Originally, step 1 was step 2, but doing this first will help you avoid the problems I ran into. So, open up windows explorer, right click the start button -> explore, and scroll down to your windows folder. Find a folder called 'Temporary Internet Files', and right click and rename it to 'Temporary_Internet_Files'. Hit ok when prompted. Now, I am going to recommend restarting windows at this point only because IE is so tightly integrated with windows (can you say anti-trust), that we IE refused to do this and got mucked up. Furthermore, without renaming this, my editor became confused because IE was passing a weird directory name.

    2. Edit Registry



    Ok, now follow these directions to set it up:

    • From Start -> Run, open 'regedit'
    • Expand the folders to: HKEY_LOCAL_MACHINE/Software/Microsoft/Internet Explorer
    • Select/highlight the 'Internet Explorer' folder in the left pane
    • Right-click the selected folder, select New -> Key
    • Rename the new key to 'View Source Editor'
    • Select/hightlight the 'View Source Editor' folder in the left pane
    • Right-click the selected folder, select New -> Key
    • Rename the new key to 'Editor Name'
    • Select/highlight the 'Editor Name' folder in the left pane
    • In the right pane you will see an object '(Default)', double-click it to enter in path to editor
    • Enter in the path to your favorite editor, 'C:/Program Files/UltraEdit/Uedit32.exe'
    • Close regedit


    Thats it... Now open up IE, and view source TAA-DAA

    展开全文
  • Page view Navigation

    千次阅读 2012-04-17 11:40:59
    Managing the Page Navigation  currentPage property  numberOfPages property  hidesForSinglePage property 示范A= = == == = =  用UIPageViewController来实现,通过改变其所包含的...
     
    

    Managing the Page Navigation

    •   currentPage  property
    •   numberOfPages  property
    •   hidesForSinglePage  property
    • 示范A= = == == = =
    •  用UIPageViewController来实现,通过改变其所包含的viewcontroller,快速实现翻页效果,代码量最小,基本方法就是:
    • pageViewController viewControllerAfterViewController

      pageViewController viewControllerBeforeViewController

    •     // make a page view controller
          UIPageViewController* pvc = [[UIPageViewController alloc] 
                                       initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl
                                       navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal 
                                       options:nil];
          
          // give it an initial page
          Pep* page = [[Pep alloc] initWithPepBoy:[self.pep objectAtIndex:0] nib: nil bundle: nil];
          //nib is nil as by default, it will go to load the nib with same name...
          
          [pvc setViewControllers:[NSArray arrayWithObject:page]
                             direction:UIPageViewControllerNavigationDirectionForward
                              animated:NO completion:NULL];


    • 从自动nib关联,动态调整view的内容。
    • - (void)viewDidLoad

      {

          [super viewDidLoad];

          self.name.text = self.boy;

          self.pic.image = [UIImage imageNamed

                      [NSString stringWithFormat: @"%@.jpg", [self.boy lowercaseString]]];

      }

      ==向前翻动和向后翻页
      -(UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController 
      {
          NSString* boy = [(Pep*)viewController boy];
          NSUInteger ix = [self.pep indexOfObject:boy];
          //反向 的查找... ...
          ix++;
          if (ix >= [self.pep count])
              return nil;
          return [[Pep alloc] initWithPepBoy:[self.pep objectAtIndex:ix] nib: nil bundle: nil];
          //返回新对象
      }
      //viewControllerBeforeViewController
      -(UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController {
          NSString* boy = [(Pep*)viewController boy];
          NSUInteger ix = [self.pep indexOfObject:boy];//先获得内容
          if (ix == 0)
              return nil;
          return [[Pep alloc] initWithPepBoy:[self.pep objectAtIndex:--ix] nib: nil bundle: nil];//后创建对象view controller
      }
      

      示范B= = == == = =

      用xcode 4.3 for iOS 5.0的默认template产生的翻页程序,由于采用了storyboard,似乎复杂了些!这个template的特别之处是没有机会让用户选择 是否要使用storeboard,


      @property (strong, nonatomic) UIPageViewController *pageViewController;

          self.pageViewController = [[[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil] autorelease];
          self.pageViewController.delegate = self;
      
          flyDataViewController *startingViewController = [self.modelController viewControllerAtIndex:0 storyboard:self.storyboard];
          NSArray *viewControllers = [NSArray arrayWithObject:startingViewController];
          //set the viewcontroller as container...
          [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:NULL];
      

      基本来说,结构一样,先初始化自己,(这段代码是没有ARC启用的)然后初始化default viewcontroller,然后pageviewcontroller setViewcontrollers。这里的一个特别的地方是

      从storyboard获得sub viewcontroller。

      @interface flyModelController : NSObject <UIPageViewControllerDataSource>
      
      - (flyDataViewController *)viewControllerAtIndex:(NSUInteger)index storyboard:(UIStoryboard *)storyboard
      //一般而言一个app一个storayboard,如此更具备通用性
      - (NSUInteger)indexOfViewController:(flyDataViewController *)viewController;
      //逆向计算viewController的index,用于定位下一个/上一个。。。 是两个辅助函数
      
      @end
      在这个模板中,把

      <UIPageViewControllerDelegate>和datasource协议分开在两个class中实现,上一个简洁的就直接在 appdelegate中全部搞定了

      @interface AppDelegate : UIResponder <UIApplicationDelegate, UIPageViewControllerDataSource>
      

      真正的datasource就是如下(和之前一样没什么。。。):

      #pragma mark - Page View Controller Data Source
      
      - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
      {
          NSUInteger index = [self indexOfViewController:(flyDataViewController *)viewController];//method 1
          if ((index == 0) || (index == NSNotFound)) {
              return nil;
          }
          
          index--;
          return [self viewControllerAtIndex:index storyboard:viewController.storyboard];//method 2
      }
      
      - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
      {
          NSUInteger index = [self indexOfViewController:(flyDataViewController *)viewController];
          if (index == NSNotFound) {
              return nil;
          }
          
          index++;
          if (index == [self.pageData count]) {
              return nil;
          }
          return [self viewControllerAtIndex:index storyboard:viewController.storyboard];
      }
      
      = = = =》storyboard中通过vc identifier来获取vc instance
        // Create a new view controller and pass suitable data.
          flyDataViewController *dataViewController = [storyboard instantiateViewControllerWithIdentifier:@"flyDataViewController"];
          dataViewController.dataObject = [self.pageData objectAtIndex:index];


      看到上面细致的效果,amzaing,其实仔细一看,这个template产生的文件虽然很多,倒是很符合Mvc的。Modelcontroller提供数据,算data model,所有数据访问操作来自它,它adopt pageview的

      datasource protocol。dataviewcontroller实现了view,以及如何把数据展现到view outlet了,算view;rootviewcontroller实现了

      @interface flyRootViewController : UIViewController <UIPageViewControllerDelegate>,自然就是真正的controller。

      那appdelegate只是作为一个entrance,custom 代码一点也没有,直接导向第一个rootviewcontroller,从之前的storyboard截图来看,两个viewcontroller之间没有segue,是通过代码方式使用的 



      下面看看controller是怎么做到的:

      //only one instance by getter inside class...
      //@synthesize modelController = _modelController;
      - (flyModelController *)modelController
      {
           // Return the model controller object, creating it if necessary.
           // In more complex implementations, the model controller may be passed to the view controller.
          if (!_modelController) {
              _modelController = [[flyModelController alloc] init];
          }
          return _modelController;
      }


      [self.view addSubview:self.pageViewController.view];
      
          // Set the page view controller's bounds using an inset rect so that self's view is visible around the edges of the pages.
          CGRect pageViewRect = self.view.bounds;
          pageViewRect = CGRectInset(pageViewRect, 50.0, 40.0);
          self.pageViewController.view.frame = pageViewRect;
      
          [self.pageViewController didMoveToParentViewController:self];
          //Called after the view controller is added or removed from a container view controller.
      
          // Add the page view controller's gesture recognizers to the book view controller's view so that the gestures are started more easily.
          self.view.gestureRecognizers = self.pageViewController.gestureRecognizers;

      这个代码还有些意思的,通过subview利用了原windowview的边框,通过didmovetoparentviewcontroller可以实现与presented viewcontroller交互,通过gesture的转移,方便了翻页

      因为我们留了边界,这么做可以帮助翻页手势识别从边上开始。

      delegate的方法基本是 optional的,实现了一个,就是在landscape时候,书本是双页显示内容的,那么要计算view的位置:

      - (UIPageViewControllerSpineLocation)pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation)orientation
      {
          if (UIInterfaceOrientationIsPortrait(orientation)) {
              // In portrait orientation: Set the spine position to "min" and the page view controller's view controllers array to contain just one view controller. Setting the spine position to 'UIPageViewControllerSpineLocationMid' in landscape orientation sets the doubleSided property to YES, so set it to NO here.
              UIViewController *currentViewController = [self.pageViewController.viewControllers objectAtIndex:0];
              NSArray *viewControllers = [NSArray arrayWithObject:currentViewController];
              [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:NULL];
              
              self.pageViewController.doubleSided = NO;
              return UIPageViewControllerSpineLocationMin;
          }
      
          // In landscape orientation: Set set the spine location to "mid" and the page view controller's view controllers array to contain two view controllers. If the current page is even, set it to contain the current and next view controllers; if it is odd, set the array to contain the previous and current view controllers.
          flyDataViewController *currentViewController = [self.pageViewController.viewControllers objectAtIndex:0];
          NSArray *viewControllers = nil;
      
          NSUInteger indexOfCurrentViewController = [self.modelController indexOfViewController:currentViewController];
          if (indexOfCurrentViewController == 0 || indexOfCurrentViewController % 2 == 0) {
              UIViewController *nextViewController = [self.modelController pageViewController:self.pageViewController viewControllerAfterViewController:currentViewController];
              viewControllers = [NSArray arrayWithObjects:currentViewController, nextViewController, nil];
          } else {
              UIViewController *previousViewController = [self.modelController pageViewController:self.pageViewController viewControllerBeforeViewController:currentViewController];
              viewControllers = [NSArray arrayWithObjects:previousViewController, currentViewController, nil];
          }
          [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:NULL];
      
      
          return UIPageViewControllerSpineLocationMid;
      }








    展开全文
  • 1. 出现“The content of thebody cannot be ... Please switch to the source view toexamine the raw content.”原因: 重新部署deploy.xml文件,重新放在tomcat/webapps/ode/processes文件夹下,重启tomcat。
  • Source Insight

    千次阅读 2011-02-26 14:16:00
    Source Insight实质上是一个支持多种开发语言(java,c ,c 等等)的编辑器,只不过由于其查找、定位、彩色显示等功能的强大,常被我们当成源代? 朐亩凉ぞ呤褂谩? 作为一个开放源代码的操作系统...
  • 简单配置SourceInsight

    千次阅读 2015-01-10 16:10:16
    SourceInsight是一款很优秀的代码编辑器,但是我从下到软件、到配出自己喜欢的编辑环境,花费了不少时间。于是写下总结,希望帮助同为初学的人。[@more@] 配置简单可用的SourceInsight 简介与安装(本部分整理自一...
  • Source Insight设置

    千次阅读 2015-01-10 16:14:17
    view --> draft view ", 就可以让每个字符的宽度一致了。快捷键是 " Alt + F12 " 4选中几行代码按tab键或者shift+tab可以左右移动代码,调整代码时很有用。 配置成简单好用的 c/java 代码编辑器 1 ...
  • source sight 使用技巧

    千次阅读 2015-01-21 17:35:21
    1 sourceinsight screen font 的默认字体是Verdana的,它是一直变宽字体。在Document style中可以将字体改为定宽的Courier  2 勾掉indent Open Brace和Indent Close Brace的效果: 继上一段,在相对缩进行里, ...
  • source insight使用方法简介

    万次阅读 2017-09-13 16:48:20
    Source Insight是一个面向项目开发的程序编辑器和代码浏览器,它拥有内置的对C/C++, C#和Java等程序的分析。Source Insight能分析你的源代码并在你工作的同时动态维护它自己的符号数据库,并自动为你显示有用的上...
  • SourceInsight4.0.0089

    2018-01-18 23:24:47
    View Changes 1. Macro event DocumentChanged was not called when a file was changed outside of Source Insight and then reloaded. 2. C++: Uniform initialization using braces was not working. For ...
  • Unity API 文档之Audio Source

    千次阅读 2013-09-20 09:25:59
    Audio Source 音频资源 The Audio Source plays back an Audio Clip in the scene. If the Audio Clip is a 3D clip, the source is played back at 在场景中音频剪辑回放。如果音频剪辑资源是3D的,这个...
  • Eclipse Source Code

    千次阅读 2013-01-07 09:40:49
    Eclipse Source Code Tutorial This tutorial explains how to work with the Eclipse source code. It assumes that you are already familiar with using the Eclipse IDE and is based on Eclipse 4.2 (Eclipse
  • source insight 快捷键列表

    千次阅读 2018-10-26 11:17:45
    Custom Cmd: Sync to Source Control Proje Custom Cmd: Undo Check Out Custom Cmd: Windows Explorer Edit: Back Tab Shift+Tab Edit: Backspace Shift+BackSpace, BackSpace ...
  • Molecules source code

    千次阅读 2011-05-02 16:27:00
    From: http://sunsetlakesoftware.com/2008/10/02/molecules-source-code-now-availableOctober 2, 2008 With the lifting of the Nondisclosure Agreement on the iPhone SDK, I'm pleased to finally make ...
  • source insight操作指南

    千次阅读 2018-12-31 16:56:22
    source insight 常用快捷键(右键里大多功能有快捷键提示)  退出程序 : Alt+F4  重画屏幕 : Ctrl+Alt+Space  完成语法 : Ctrl+E  复制一行 ...
  • debian 资源列表 source.list

    千次阅读 2013-01-15 19:08:11
    debian source.list 大全 在安装raspberry pi的系统时,需要debian的资源列表。我将发现的资源列出来供大家参考。该资源只限debian,其中包含大量的第三方source repo。 # If you maintain a Debian repo ...
  • 烤鸭的Source Insight学习笔记

    万次阅读 2012-12-14 17:04:03
    如果你觉得这网页排版不好看,可以去下载我上传的word版:《烤鸭的Source Insight...烤鸭的SourceInsight学习笔记 1.前言 写这份文档时,我用的SI版本是:Version 3.5。 2.常用设置 2.1.缩进 Options菜单Docume
  • Open Source GIS

    千次阅读 2012-04-24 14:51:14
    for a view of places tagged "ecotourism". Browse tags or browse categories to see other types of information in the system. Users can currently add features and tags and save views. Comments are ...
  • source insight相关

    千次阅读 2011-10-24 14:09:11
     请教同事发现选上"view --> draft view", 就可以让每个字符的宽度一致了。快捷键是 "Alt + F12" 3、"shift+F8" 标亮所有文本中光标所在位置的单词 4、跳到某一行:"ctrl + g" Source Insight是阅读和...
  • .NET Open Source Developer Projects

    千次阅读 2017-03-26 16:59:41
    This community maintained list showcases .NET open source developer projects. It is intended to include projects that are useful for any aspect of the development process. For consumer projects, see t
  • source insight 常用快捷键

    千次阅读 2013-07-17 09:47:55
    source insight 常用快捷键(右键里大多功能有快捷键提示)   退出程序 : Alt+F4 重画屏幕 : Ctrl+Alt+Space 完成语法 : Ctrl+E 复制一行 
  • Source Insight基本使用和快捷键

    万次阅读 2017-05-10 20:32:23
    Source Insight基本使用和快捷键    为什么要用Source Insight呢?貌似是因为比完整的IDE要更快一些,比较利于查看大量的代码。  软件的安装很简单,设置好安装目录。  配置好文档路径,当然这个也可以在...
  • All browsers include a "View Source" option, but none of them offer the ability to view the source code of external files. Most websites store their javascripts and style sheets in external files and ...
  • source insight常用快捷键

    千次阅读 2013-10-23 14:04:01
    选上"view --> draft view", 就可以让每个字符的宽度一致了。快捷键是 "Alt + F12" "shift+F8" 标亮所有文本中光标所在位置的单词 source insight 编辑代码时,要用到它的函数提示而不带参数:在option...
  • discuz程序模块source功能处理目录注释   转载▼  /source/admincp后台管理,点击查看Discuz! X2.5 upload下全站论坛目录结构注释  /source/admincp/cloud云平台项目  /source/admincp/menu后台...
  • Resin Application Server 4.0.36 Source Code Disclosure Vulnerability Vendor: Caucho Technology, Inc. Product web page: http://www.caucho.com Affected version: Resin Professional Web And Application
  • 场景:对于小程序官方提供的picker基本能满足...但官方最近新提供了picker-view ,可根据自己的使用场景来自定义自己的picker。 1.wxml <!-- 楼层的picker --> <view class='lcBtn flex flexC'> &l...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 73,864
精华内容 29,545
关键字:

pagesourceview