summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/user_script.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix exclude_matches functionalityaa@chromium.org2011-12-191-53/+49
| | | | | | | | | | | | This should allow the manifest to use the exclude_matches field in content scripts successfully. BUG=107505 TEST=See bug. A simple extension to test the exclude matches functionality, compliments of mihaip@chromium.org, is attached. Review URL: http://codereview.chromium.org/8963010 Patch from Devlin Cronin <RDevlin.Cronin@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114960 0039d316-1c4b-4281-b951-d872f2087c98
* Allow all URLPatterns to have ports.aa@chromium.org2011-12-191-1/+1
| | | | | | | | | | | | | | This is a minor breaking change, but after looking at the data, I don't think it's worth maintaining backward compat. I will mail the authors of the extensions that are affected to warn them. BUG=104104 Review URL: http://codereview.chromium.org/8970020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114957 0039d316-1c4b-4281-b951-d872f2087c98
* Define kValidUserScriptSchemes in the .h file so that it can bethakis@chromium.org2011-12-091-5/+0
| | | | | | | | | | | | | evaluated at compile time in extension.cc. Removes 1 static initializer on both linux and mac. BUG=94925 TEST=none Review URL: http://codereview.chromium.org/8892012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113880 0039d316-1c4b-4281-b951-d872f2087c98
* Move URLPattern::ParseOption into a field.aa@chromium.org2011-12-091-3/+2
| | | | | | | | | | | This will be needed to change the default of URLPattern to USE_PORTS. BUG=104104 Review URL: http://codereview.chromium.org/8885022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113730 0039d316-1c4b-4281-b951-d872f2087c98
* Update URLPatternSet to contain a std::set instead of std::vector.jstritar@chromium.org2011-07-131-5/+5
| | | | | | | | | | | This updates URLPatternSet to contain a std::set instead of a std::vector, making it easier to implement the set operations in ExtensionPermissionSet. BUG=84507 TEST=unit_tests Review URL: http://codereview.chromium.org/7347011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92364 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 92219 - Update URLPatternSet to contain a std::set instead of ↵jstritar@chromium.org2011-07-121-5/+5
| | | | | | | | | | | | | | | | | std::vector. This updates URLPatternSet to contain a std::set instead of a std::vector, making it easier to implement the set operations in ExtensionPermissionSet. BUG=84507 TEST=unit_tests Review URL: http://codereview.chromium.org/7347011 TBR=jstritar@chromium.org Review URL: http://codereview.chromium.org/7346019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92224 0039d316-1c4b-4281-b951-d872f2087c98
* Update URLPatternSet to contain a std::set instead of std::vector.jstritar@chromium.org2011-07-121-5/+5
| | | | | | | | | | | | This updates URLPatternSet to contain a std::set instead of a std::vector, making it easier to implement the set operations in ExtensionPermissionSet. BUG=84507 TEST=unit_tests Review URL: http://codereview.chromium.org/7347011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92219 0039d316-1c4b-4281-b951-d872f2087c98
* Use extension match pattern syntax in content settings extension API.bauerb@chromium.org2011-06-301-1/+1
| | | | | | | | | | This requires adding a port to a URLPattern, but that shouldn't change existing behavior, as we already have a lenient parsing mode there. BUG=71067 Review URL: http://codereview.chromium.org/7229012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91099 0039d316-1c4b-4281-b951-d872f2087c98
* Add exclude_matches to content_scripts for negating match patterns.tessamac@chromium.org2011-05-291-0/+9
| | | | | | | | | BUG=13487 TEST=unit_tests and trybots Review URL: http://codereview.chromium.org/7053021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87192 0039d316-1c4b-4281-b951-d872f2087c98
* Rename ExtensionExtent to URLPatternSet and use URLPatternSet instead of ↵morrita@chromium.org2011-05-201-20/+10
| | | | | | | | | | | | | | | | | | std::vector<URLPattern> - Rename ExtensionExtent to URLPatternSet - Refactor common/extensions/user_script.h, common/extensions/user_script.cc, common/extensions/file_browser_handler.h and common/extensions/file_browser_handler.cc so that they use URLPatternSet instead of std::vector<URLPattern> - At many places rename std::vector<URLPattern> to URLPatternList, which is typedefed at common/extensions/url_pattern.h - Rename URLPatternSet::ClearPaths() to URLPatternSet::ClearPatterns() - Rename URLPatternSet::ContainsURL() to URLPatternSet::MatchesUrl() BUG=72955 TEST=ExtensionManifestTest.FileBrowserHandlers, ExtensionUserScriptTest.*, ExtensionURLPatternTest.* Review URL: http://codereview.chromium.org/7038029 Patch from Kentaro Hara <haraken@google.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86060 0039d316-1c4b-4281-b951-d872f2087c98
* Make <all_urls> and file:///* in permissions trigger "Allow file access"mihaip@chromium.org2011-04-011-7/+12
| | | | | | | | | | | | | | | | | | | Move ExtensionWantsFileAccess static functions to Extension::wants_file_access which is set as part of the Extension initialization process. When file:/// access is granted/revoked, instead of storing that in a bit on the UserScript (which didn't help with extension host permissions), we use that to filter down the list of valid schemes for permissions/content script match matterns. That way we don't have to manually exclude file:///* patterns at various call sites (e.g. in UserScriptSlave). BUG=76705 TEST=unit_tests R=aa@chromium.org Review URL: http://codereview.chromium.org/6772022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80213 0039d316-1c4b-4281-b951-d872f2087c98
* Don't try to convert text/html URLs ending in .user.js.aa@chromium.org2011-03-051-8/+4
| | | | | | | | | | | | This doesn't solve the problem with view-source://, that is a separate issue. BUG=35795 TEST=manual, see bug. Review URL: http://codereview.chromium.org/6574033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77020 0039d316-1c4b-4281-b951-d872f2087c98
* Give a helpful warning message if a url patern contains a port.skerner@chromium.org2011-03-041-1/+2
| | | | | | | | | BUG=32160 TEST=ExtensionURLPatternTest.Ports,ExtensionManifestTest.* Review URL: http://codereview.chromium.org/2835034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76967 0039d316-1c4b-4281-b951-d872f2087c98
* Change other usages of .size() to .empty() when applicable.erg@google.com2011-03-041-3/+3
| | | | | | | | | BUG=carnitas TEST=compiles Review URL: http://codereview.chromium.org/6609008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76962 0039d316-1c4b-4281-b951-d872f2087c98
* Allow URLPatterns to omit trailing slash.aa@chromium.org2010-10-261-1/+1
| | | | | | | | | | | Also, a regression had been introduced in earlier changes. Added explicit error codes to Parse(), and removed default constructor, to avoid making the same mistake again. BUG=49969 TEST=n/a Review URL: http://codereview.chromium.org/3978007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63836 0039d316-1c4b-4281-b951-d872f2087c98
* Make the glob matcher support UTF8 strings.mnissler@chromium.org2010-09-101-2/+2
| | | | | | | | | | | This generalizes the existing pattern matching code to support UTF8 strings. BUG=53158 TEST=string_util_unittests.cc Review URL: http://codereview.chromium.org/3295018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59071 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Forward declare and move constructors in chrome/common/extensions/.erg@google.com2010-08-261-5/+35
| | | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/3207002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57543 0039d316-1c4b-4281-b951-d872f2087c98
* Add a wildcard scheme and a special 'all_urls' pattern to URLPattern.mpcomplete@chromium.org2010-06-301-1/+10
| | | | | | | | BUG=47179 Review URL: http://codereview.chromium.org/2884008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51295 0039d316-1c4b-4281-b951-d872f2087c98
* Require user opt-in before allowing content script injection on file URLs.mpcomplete@chromium.org2010-06-241-0/+2
| | | | | | | | BUG=47180 Review URL: http://codereview.chromium.org/2809034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50737 0039d316-1c4b-4281-b951-d872f2087c98
* Initial work on making extensions work in incognito mode.mpcomplete@chromium.org2010-02-111-12/+3
| | | | | | | | | | | | This merely adds a way to enable content scripts and browser actions in incognito windows. They still don't work properly because none of the APIs work with incognito tabs. The way to enable an extension is to add an "incognito" bit in the user prefs file. My plan is to add UI for this later. BUG=32365 Review URL: http://codereview.chromium.org/567037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38852 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes to the string MatchPattern functions:tony@chromium.org2009-12-031-1/+1
| | | | | | | | | | | | | | | 1) Make it explicit that it only supports ASCII (since it iterates character by character). 2) Limit the recursion to 16 levels. We could allow more, but in the case of a ?, it has exponential complexity, so I figured 16 was a good stopping point. It seems rare that someone would have more than 16 '?' and '*'s. BUG=28645 Review URL: http://codereview.chromium.org/460047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33748 0039d316-1c4b-4281-b951-d872f2087c98
* Introduce a new 'all_frames' property to content scripts andaa@chromium.org2009-11-251-0/+6
| | | | | | | | | | | default it to false. This should improve performance in sites that use frames and elimiate confusion, since in most cases developers *don't* expect content scripts to match frames. Review URL: http://codereview.chromium.org/412008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33035 0039d316-1c4b-4281-b951-d872f2087c98
* Add first class support for user scripts.aa@chromium.org2009-11-041-10/+65
| | | | | | | | | | | | Original review: http://codereview.chromium.org/340057 TBR=mpcomplete@chromium.org BUG=22103 TEST=Install a user script (such as from userscripts.org). You should get the extension install UI and the script should show up in the extension management UI. It should also work, though some scripts use Firefox-specific APIs and those won't work in Chromium. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30925 0039d316-1c4b-4281-b951-d872f2087c98
* Update of the extension install UI:aa@chromium.org2009-08-271-2/+2
| | | | | | | | | | | | | | | | | - Give the user more information about which hosts an extension can access. - Remove the red severe warning because it doesn't play well with themes and because it adds nothing when the other text is more specific. - Make the image a bit smaller. Also integrate this new idea with the silent/not-silent update flow. BUG=12129,12140,19582 Review URL: http://codereview.chromium.org/173463 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24599 0039d316-1c4b-4281-b951-d872f2087c98
* Small cleanup of constness.mad@google.com2009-06-181-2/+2
| | | | | | | | | | | | | Added const to methods not changing the state, except for the lazy setting of an escaped version of a path which is now mutable. Also made some lint fixes. BUG=none TEST=none Review URL: http://codereview.chromium.org/132024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18733 0039d316-1c4b-4281-b951-d872f2087c98
* Try one more time to check in http://codereview.chromium.org/60112aa@chromium.org2009-04-081-0/+6
| | | | | | | | | | | | Added this test to the list of skipped purify tests as it is experience the same issue as ExtensionView test. I also found an unrelated memory leak and created a patch separately: http://codereview.chromium.org/63073 Review URL: http://codereview.chromium.org/63075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13369 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Implement chromium.self in content scripts..."aa@chromium.org2009-04-071-6/+0
| | | | | | | | | | This reverts commit 61ab30f52667e739602ab2af4fd8f2d8a0a2a2f0. Still seeing memory errors. Review URL: http://codereview.chromium.org/63056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13243 0039d316-1c4b-4281-b951-d872f2087c98
* Implement chromium.self in content scripts, so that developers don'taa@chromium.org2009-04-071-0/+6
| | | | | | | | | | | | | | | | | | | | | have to know and copy/paste their extension ID. This required moving the code that defaults the extension ID earlier in the load process. Also fixed some bugs: * fixed a bug that was causing all user scripts to get executed in the same context. * made the greasemonkey api only available in 'standalone' user scripts. * re-added the anonymous function wrapper that is supposed to wrap content scripts. Also added unit tests for the fixed bugs. Review URL: http://codereview.chromium.org/60112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13238 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unneeded uses of base/pickle.h. Add some explicit #includes.thestig@chromium.org2009-04-031-0/+1
| | | | | | Review URL: http://codereview.chromium.org/60095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13093 0039d316-1c4b-4281-b951-d872f2087c98
* Review URL: http://codereview.chromium.org/42288georged@chromium.org2009-03-181-12/+58
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12016 0039d316-1c4b-4281-b951-d872f2087c98
* Add early-injection capability to user scripts.aa@chromium.org2009-02-141-0/+6
| | | | | | Review URL: http://codereview.chromium.org/19624 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9822 0039d316-1c4b-4281-b951-d872f2087c98
* Integrate URLPattern with Extension user scripts.aa@chromium.org2009-02-051-0/+69
Also refactored the UserScript class in UserScriptSlave and the UserScriptInfo structure in UserScriptMaster into a common location. Review URL: http://codereview.chromium.org/21070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9270 0039d316-1c4b-4281-b951-d872f2087c98